All of the impurities draw their energy from one's evil cravings, meaning that a person craves and yearns, Heaven forbid, for evil desires. Every person needs to prevent the desires of his heart, and to accustom himself to always crave and long for holy desires, for Hashem, and serving Him. And, this too is an aspect of the purity of the mikveh, for the mikveh is an aspect of the waters of kindness that are made through holy desires. And, through them (holy desires) one is purified from all of the impurities, and is worthy of having Torah revealed to him, which is also an aspect of water as is known.
(The Ari z"l's mikveh)
I hear time and time again that the point of Judaism is about the deed, and that one's thoughts have no consequence. So many people think that while they must act in accordance with halacha and Jewish social norms, their minds are free to have a mental mardi-gras frat party. There's nothing that could be further from the truth, because action, emotion, overall well being, and connection to Hashem are rooted in thought.
What's interesting about what Reb Nosson says is that tuma isn't nourished or perpetuated by one's evil actions. Rather, he says that tuma draws from one's thoughts. The evil that exists in this world is fed by one's evil desires and cravings regardless of whether or not that person acts on such desires. Even if he decides to ignore those thoughts the damage has been done.
Reb Nosson stresses the importance of always thinking about spiritual matters and serving Hashem, because such thoughts have the power of a mikveh. As soon as one begins to think about holiness all of the tuma that benefited from one's evil thoughts are now washed away, and one can return to Hashem. Amazing.