Riya, or insincerity and pretentiousness, occurs when someone lacks knowledge of their Creator. They do not glorify Allah as He should be glorified, and instead seek the compliments and praise of the people. Whoever truly knows Allah will make all their deeds sincerely for Him alone.
People vary in the degree to which they suffer from this disease. Some people seek praise from others only, some seek the pleasure of Allah as well as the praise of the people, and some do not seek other people’s praise at all, however when people see them doing good deeds, they improve their work to be praised. In the latter case it becomes a lesion that has affected the good deed.
The general cure for this disease is to know Allah truly. For whoever knows Him would make all their actions for Him sincerely and would not want to impress anyone except Him. We should place ourselves in the position of the worshipper, not in the position of the worshipped. Know that reward is only given for sincere deeds, everything else is meaningless. Umar ibn al-Khattab, may Allah be pleased with him, narrated that the Prophet, peace be upon him, said:
“Surely, all actions are but driven by intentions and, verily, every man shall have but that which he intended…” (Recorded in al-Bukhari)
You can find a detailed narration of this hadith and its meanings here. Mahmud ibn Lubayd, may Allah be pleased with him, narrated that the Messenger of Allah, peace and blessings of Allah be upon him, said:
“‘What I fear for you the most is minor shirk!’ They said ‘O Messenger of Allah! What is that?’ He said, ‘Riya. Allah Exalted be He, says on the Day of Judgement, after He recompenses people for their deeds: Go to those who you used to show your deeds off to and see if they have a recompense.” (Recorded in Ahmad)
Know also that the punishment for riya is severe. Abu Hurairah, may Allah be pleased with him, narrated that the Prophet, peace and blessings of Allah be upon him, said:
“The first to be judged on the Day of Judgement will be a man who dies as a martyr. He shall be brought forth. Allah will make him recount his blessings and he will recount them. Then Allah will say: What did you do (to requite these blessings)? He will say: I fought for you until I died as a martyr. Allah will say: You have told a lie. You fought that you might be called ‘a brave warrior’. And you were called so. (Then) orders will be passed against him and he will be dragged with his face downward and cast into Hell.
Then will brought forward a man who acquired knowledge, who imparted it (to others) and recited the Qur’an. He will be brought, Allah will make him recount his blessings, he will recount them. Then Allah will ask: What did you do to (requite these blessings)? He will say: I acquired knowledge and disseminated it and recited the Qur’an seeking your pleasure. Allah will say: You have told a lie. You acquired knowledge so that you may be called ‘a scholar’ and you recited the Qur’an so that it might be said: ‘He is a reciter’ and such has been said. Then the orders will be passed against him, he shall be dragged with his face downward and cast into the Fire.
Then will brought forward a man whom Allah made abundantly rich and granted every kind of wealth. He will be brought, Allah will make him recount h,is blessings, he will recount them. Then Allah will ask: What did you do to (requite these blessings)? He will say: I spent money in every cause in which you wished that it be spent. Allah will say: You are lying. You did (so) that it might be said about you: ‘He is generous’ and so it was said. Then Allah will pass orders, he will dragged with his face downward and thrown into Hell.” (Recorded in Muslim)
SubhanAllah this is such a devastating hadith. Truly frightening and a wake up call for us all to check our intention and sincerity. O Allah! Purify our intentions and make all our actions for Your sake alone. Ameen.