Jubair b. Mut’im reported : People made a mention of washing because of sexual defilement before the Messenger of Allah (May peace be upon him). The Messenger of Allah (May peace be upon him) said: I pour (water) on my head three times. And he made a sign with both his hands.
The Prophet Muhammad (peace be upon him) also taught us that we should not only focus on physical cleanliness but also strive for spiritual purity through prayer, fasting, charity, etc., which will help us become closer to Allah Almighty and gain His mercy in this life as well as the hereafter.