Teachings of Maimonides
It is emphasized that the purpose of immersion is not physical, but spiritual, cleanliness. Maimonides concludes his codification of the laws of the mikveh with the following statement:
It is plain that the laws about immersion as means of freeing oneself from uncleanness are decrees laid down by Scripture and not matters about which human understanding is capable of forming a judgment; for behold, they are included among the divine statues. Now 'uncleanness is not mud or filth which water can remove, but is a matter of scriptural decree and dependent on the intention of the heart. Therefore the Sages have said 'If a man immerses himself without special intention, it is though he has never immersed himself at all'. Nevertheless we may find some indication [for moral basis] of this: Just as one sets his heart on becoming clean as soon as he has immersed himself, although nothing new has befallen his body, so, too, one who sets his heart on cleansing himself from uncleanness that beset men's souls - namely, wrongful youghts and false convictions - becomes clean as soon as he consents in his heart to shun those counsels and brings his soul into the waters of pure reason. Behold, Scriptures say 'And I will sprinkle clean water upon you and you shall be clean; from all your uncleanness and from your idols I will cleanse you [Ezek, 36:25] (Yad, mikva'ot 11:12).
Stress on intention is passed from Judaism into Islam. "Purity is the half of faith" is the saying attributed to Muhammad himself and the general laws of uncleanness in Islam bear a striking resemblance to those of Judaism. (Encyclopedia of Islam, s.v.Takara)