[Explanation in the light of Surah an-Nisa Ayah 38 and 39]
In Ayah 38, beginning with the words, وَالَّذِينَ يُنْفِقُونَ another trait in the character of the arrogant has been described. They themselves hold back any spending in the way of Allah and persuade others to do the same. Nevertheless, when they wish to show off before people, they do spend. Since these people do not believe in Allah and the Last Day, the question of spending their wealth for the pleasure of Allah subhanahu wa ta’ala and with the intention of earning rewards in the life-to-come just does not arise. Such people are the accomplices of Shaytan, therefore, the end of it all will be no different than the end of their comrade Shaytan.
This ayah tells us that the way it is disgraceful to be niggardly and tardy in fulfilling due rights, similarly, it is also awful to spend to show off or to spend on heads which are purposeless. A good deed aimed at drawing applause from people – and which is not for Allah exclusively – is a deed not acceptable in the sight of Allah. In hadeeth, it has been declared as shirk.
Abu Huraira radhiAllahu anhu narrates that the Rasoolullah salAllahu aalyhi wa sallam said:
“Allah subhanahu wa ta’ala says: I am absolutely free of any need to have partners. Whoever does a (good) deed and associates in it someone else with Me, I leave him (unhelped) with this deed (of associating partners with Me).”
Shaddad ibn Aws radhiAllahu anhu narrates that he heard Rasoolullah salAllahu aalyhi wa sallam say:
“Whoever performed salah to show off, committed shirk; and whoever fasted to show off, committed shirk; and whoever gave in charity to show off, committed shirk.” [Ahmad, as cited by Mishkat]
“What fills me with grave apprehensions about you is the minor shirk.” The Companions asked: “O Messenger of Allah, what is the minor shirk?” He said: “Riya (i.e. to do a good deed just to show off).” [Ahmad, as cited by Mishkat]
Here, a narration from al-Baihaqi adds that, on the Day of Resurrection, when the reward for good deeds will be given out, Allah subhanahu wa ta’ala will say to the person committing riya i.e. the persons who did good deed just to earn the applause of the people:
“Go to those you wanted to see you doing good deeds in the mortal world and then find out for yourself if they have the reward for your deeds.”
In Ayah 39 it is asked: What conceivable harm could have affected them if they had believed in Allah and the Last Day and spent out of what Allah had given them? What is so tough, difficult or frightening about it? All these are as easy as they come. Going by them and believing in them does not hurt or harm or cause any inconvenience. Why then, would someone elect to be disobedient, the certain outcome of which is nothing but disaster in the akhirah?
[Taken from Maarif-ul-Qur’an by Mufti Muhammad Shafi Usmani]