For some time now my Torah studies and prayers have been without any enthusiasm and joy. I feel that G-d isn't inside me at all. When I read some of the things on this site, I suddenly understood where the problem was stemming from - looking at women, fantasizing about them, and masturbating just about every day. I understand that all of these things are prohibited, but it would help me to understand more clearly why they are so harmful to my Judaism and feeling close to G-d.
Rabbi Shalom Arush has a vivid explanation for this in his wonderful book, "B'gan HaEmunah Hamivorar." He writes:
Rabbi Shalom Arush
When a man blemishes the Brit by fantasizing about women, or by speaking licentiously, or by committing a sexual transgression, he pollutes his heart and he thus cannot feel the Holy One Blessed Be He in his heart, nor pray to Him. This is because the spirit of sexual immorality is an impure spirit that uproots a man from his holiness and faith. Since the principle seat of G-d's Presence in a person is in the heart, when the heart is polluted with the spirit of sexual immorality, the Presence of G-d cannot dwell there. This brings about a disconnection from holiness and an inability to attain emunah [faith] and true prayer.
This is the reason that blemishing the Brit is known as "orlah," a thick covering like the foreskin that anesthetizes the heart and the faculty of emunah. Thus as soon as a man blemishes his Brit, G-d forbid, he cannot open his mouth in true prayer because of the orlah [foreskin] that envelops his heart and severs him from Hashem, may He be blessed.
Furthermore, the person who spills his seed in vain, blemishes his faculty of spiritual intelligence, called "daat," since the seminal seed originates in the brain. In effect, whoever spills semen in vain is depleting a portion of his brain, and this is what damages his "daat." This is the reason that mental disturbances are connected to blemishes to the Brit. The holy Zohar explains that a person who damages his mental faculties in this manner comes to all sorts of poverty, whether it be in his livelihood, his mental state, or his lack of faith which finds expression in depression, melancholy, and anger, which are all diseases of the soul.
When a man blemishes his Brit, his holiness suffers a drastic descent, and since holiness is connected to faith, when he falls in his holiness, he blemishes his faith and all aspects of his life, including his health, marital happiness, livelihood, state of mind, etc.
Gazing at women will necessitate spiritual open heart surgery.
Sexual immorality stands in opposition to Judaism more than anything else. This is the reason that Bilaam advised Balak to weaken Israel through sexual transgression, saying, "The G-d of these people hates licentiousness more than anything else." For at the root of Judaism is the will to cleave to G-d, and a person's will is directly related to the purity of his sexual life (Tikun HaBrit).
Since the driving force behind sexual transgression is a powerful animal desire and lust - a desire opposite of holiness - when a man falls to the passions of licentiousness, he loses all of his love and desire for G-d. He loses all of his desire and will to learn Torah and to perform the commandments. In addition, he feels alienated from prayer and from the intimate conversation with G-d ("hitbodedut"), which are the principle expressions of emunah.
[From the book, "B'gan HaEmunah Hamivorar," pgs 259-261, by Rabbi Shalom Arush].