Purification of the heart is important because of this

Heart is the center of human body, life and all activities. When the heart is pure, everything becomes pure. If the heart is impure, everything becomes impure. On the authority of Noman Ibn Bashir (RA), the Messenger of Allah (PBUH) said,

أَلاَ وَإِنَّ فِي الْجَسَدِ مُضْغَةً إِذَا صَلَحَتْ صَلَحَ الْجَسَدُ كُلُّهُ, وَإِذَا فَسَدَتْ فَسَدَ الْجَسَدُ كُلُّهُ.‏ أَلاَ وَهِيَ الْقَلْبُ
There is a piece of flesh in the body, when it is healed, the whole body is healed. And when it goes bad, the whole body goes bad. That piece of meat is the heart. (Sahih Bukhari, Sahih Muslim)

Hafez Ibn Rajab (RA) said, when the heart of a person is right, then his actions are also right. His limbs then move only for the pleasure of Allah. He also said that when the heart is pure, it is essential that the actions become pure.

Some people of little knowledge think that in this hadith a distinction is made between purification of heart and purification of work. It is a misconception based on ignorance or malice. Iman is the combination of belief in the heart, confession of the mouth and deeds. Purification of the heart affects the outward behavior and actions of the person. The more one is purified within, the better and better one’s work becomes.

This is also understood from a hadith narrated by Abu Hurairah (RA). In that hadith, the Prophet (PBUH) mentioned heart and action together. Rasul (pbuh) said,

God does not look at your faces, nor at your wealth, but He looks at your hearts and deeds

Allah does not look at your looks or wealth, He looks at your hearts and deeds. (Sahih Muslim)

No matter how many good deeds a person does, no matter how much he worships, if he does not have faith in his heart, if he does not sincerely worship only for Allah, then his good deeds have no value.

Public worship is forbidden. It is mentioned in the hadith that if the worshiper of hypocrisy does not repent from the sin of hypocrisy or his hypocrisy, then on the Day of Judgment Allah will show him the reward of his deeds in front of all people and declare his hypocrisy to be deprived of that reward. He will be ashamed in front of everyone. The Prophet (PBUH) said,

مَنْ سَمَّعَ سَمَّعَ اللهُ بِهِ وَمَنْ يُرَائِي يُرَائِي اللهُ بِهِ

Whoever worships people, Allah will make the purpose of his worship known to the people. A person who performs public-showing worship will show people the purpose of his worship in return for Allah. (Sahih Bukhari)

In the hadith Qudsi, Allah says,

أَنَا أَغْنَى الشُّرَكَاءِ عَنِ الشِّرْكِ مَنْ عَمِلَ عَمَلاً أَشْرَكَ فِيهِ مَعِي غَيْرِي تَرَكتْهُ وَشِرْكَهُ

I am the most free from shirk among the partners. If anyone commits a deed and associates it with someone other than Me, I leave him and his partner in their condition. (Sahih Muslim)

So it is our duty to purify our hearts. To strengthen faith in one God in the heart, to strengthen complete sincerity. Freeing the heart from Shirk, Riya, if it is in the heart. If the heart is pure, our life will be pure.