Among the sins of the heart is insincerity in performing the good deeds (Riyaa’); that is, to do the good deeds for the sake of the people (to be praised by them) and this nullifies the reward.
Explanation: Among the sins of the heart is insincerity. It is an enormous sin, to the extent that the Prophet ﷺ drew a similarity between insincerity and taking partners with Allaah. It does not mean that one is actually taking partners with Allaah, but the Prophet ﷺ drew the similarity to indicate that is an enormous sin.
This type of insincerity means for one to do the good and reward-able deeds, such as praying, fasting, paying zakaah, going to Hajj, giving charity, teaching religious knowledge, and the like, for the sake of the people; for them to praise him.
If, in addition to seeking the praise of the people, he did the good deed for them to start giving him gifts, then he is getting worse. If he accepts such gifts, he would be taking it unlawfully because it is not permissible for one to appear as a pious person in order to trick others so as to receive gifts from them. If he/she takes those gifts, this is unlawful.
If someone does any good deed for the sake of the people, this person does not get any reward for this deed. If the person repents and after repenting, he does the good deed without being insincere, he gets reward for the good deeds that he does.
Being insincere and getting reward do not go together. Abu Daawud, An-Nasaa’iyy, and others narrated that a person asked the Prophet ﷺ, “What if someone fights seeking the reward and at the same time seeks for people to say he is a hero?” The Prophet ﷺ responded:
لا شىء له
Which means: “There is no reward for him.”
That man repeated the questions 3 times. The Prophet ﷺ repeated the answer: “There is no reward for him.” Then the Prophet ﷺ said:
إن الله لا يقبل من العمل إلا ما كان خالصًا له وابتغى به وجهه
Which means: “Allaah does not accept any deed except if this deed was done sincerely for the sake of Allaah only.”
From this hadith, it is clear that getting reward and insincerity do not go together. One does not get reward for any deed that one does if he is insincere while doing that deed; rather, he is committing an enormous by doing that.