As with all other acts of worship, it is important to keep the purpose of giving or spending in mind. Giving is a spiritual purification for believers. And giving away something one loves is most praiseworthy in the Sight of Allah when one does it to earn His approval. In this way, a believer will have proven that he will give up anything in this world to please Allah and obtain His mercy and that he will make every sacrifice to attain this joy. With this attitude, a believer is bound to please Allah. Allah is above all things. He commands the following:
You who believe! Give away some of the good things you have earned and some of what the earth produces for you. Do not have recourse to bad things when you give, things you would only take with your eyes tight shut! Know that Allah is Rich Beyond Need, Praiseworthy. (Surat al-Baqara; 267)
As stated in this verse, Allah forbids believers to give away only the things they dislike or want to be rid of and expects them to give away things they would use themselves.
By only appearing to be generous, a person will gain nothing in Allah’s Sight. Therefore, a believer will be careful to avoid this error which is contrary to what is revealed in the above verse and goes against the morals of the Qur’an.