It is said that even if a person is full of material desires he is directed to worship Lord Shri Krishna. Then why it is said that it is an offense to keep material attachments while chanting the mahamantra?
It is an offense as you said but if we go to Krishna with material desires even while doing offenses, we will be slowly purified and attain pure devotional service. It is an offense and will be obstacle to achieve pure devotional service. But going to Krishna even with desires will begin one’s progress toward Krishna. On the way he will be cleansed of desires as well.
How is it possible for anybody who is chanting for material desires to give up his very purpose of chanting? What is the remedy?
He will not give up desires but the effect of chanting is that the desires will dissolve. As the desires dissolve because of his chanting holy names he will be aware of real aim of holy names, that is love of Godhead.
Why go through tedious devotional service than to worship demigods as Lord Shiva who are quickly pleased?
Because you can get pure devotional service in the end even if you don’t desire it right now by worshiping Krishna with material desires. But if you worship demigods then that pure love of Godhead will not be achieved. By devotional service you will be free from material world. This cannot be achieved by worshiping demigods.