The Holy Bible (especially the Torah) does NOT ever label masturbation as a "sin", but rather, clearly illustrates that all that is necessary after the emission of sperm (whether it's during masturbation OR marital sexual intercourse) is to simply ritually cleanse oneself and anything that the sperm comes into contact with.
While there are some so-called religious "scholars" out there who claim that it is "sin", according to traditional Jewish writings. However,...we must not follow man-made tradition (which Messiah warned causes the "word of God to become of no effect"), but rather, stick to ONLY the holy and divinely-inspired Word of Yahweh. What does His Word say about seminal emissions?
"Whenever a man has an emission of sperm, he must bathe his entire body in water, and he will remain ceremonially unclean until the next evening. And every garment and every skin on which the sperm comes shall be washed with water and be unclean until the evening. If a man lies with a woman and has an emission of sperm, both of them shall bathe themselves in water and be unclean until the evening." (Leviticus 15:16-18)
Do you notice the context of this passage? Verses 16 and 17 are specifically referring to a man emitting sperm WHILE ALONE,....and then verse 18 refers to the husband and wife being together. All that is necessary for either scenario is to wash and become clean. There is absolutely NO mention anywhere of "sin" and "transgression" in reference to masturbation or the "spilling of seed", at all.
Also,...there are MANY believers who teach that masturbation not only helps cleanse the flow of sexual hormones (thus reducing the risk of cancer, etc.), boosts the immune system, relieves depression, anxiety, insomnia and other negative emotional/physical states, helping one to become relaxed, calm, and able to sleep deeply again. Likewise, for single people (and also married couples during brief periods times of sexual inactivity) it also helps to reduce the risk of sexual lust towards others by reducing the intensity of the urges, and bringing much-needed release and relief.
The "sin of Onan" (from Bereshith/(Genesis 38:3-10) is NOT about masturbation at all,...but rather, specifically coitus interruptus. He had sex with his sterile brother's wife, but deliberately refused to [bless and do not curse][bless and do not curse][bless and do not curse][bless and do not curse][bless and do not curse][bless and do not curse][bless and do not curse][bless and do not curse][bless and do not curse] within her. He went outside his tent to spill his seed upon the ground, rather than impregnating her as he should have done, in order to continue the genetic bloodline. Because he basically "sowed death" by refusing to giving the life of his seed, Yahweh killed him.
Here is one of numerous sources which confirm this reality :
"when Onan had sex with Tamar, he disregarded this principle when he withdrew before climax and "spilled his seed [or sperm] on the ground", since any child born would not legally be considered his heir. He disregarded the principle of a levirate union, so he died prematurely, exactly as God had warned would happen.....
According to some Bible critics who contextually read this passage, the description of Onan is an origin myth concerning fluctuations in the constituency of the tribe of Judah, with the death of Onan reflecting the dying out of a clan; Er and Onan are hence viewed as each being representative of a clan, with Onan possibly representing an Edomite clan named Onam, mentioned by an Edomite genealogy in Genesis.
Also, it has been suggested that God's anger was directed not at the sexual act, but at Onan's disobedience by refusing to impregnate his brother's widow. It is also clear from the text that God was not angry at all, since the word "anger" or "angry" appears nowhere in those verses.
The text emphasizes the social and legal situation, with Judah explaining what Onan must do and why. A plain reading of the text is that Onan was killed because he refused to follow instructions. Scholars have argued that the secondary purpose of the narrative about Onan and Tamar, of which the description of Onan is a part, was to either assert the institution of levirate marriage, or present an aetiological myth for its origin; Onan's role in the narrative is, thus, as the brother abusing his obligations by agreeing to sexual intercourse with his dead brother's wife, but refusing to allow her to become pregnant as a result. Emerton regards the evidence for this to be inconclusive, although classical rabbinical writers argued that this narrative describes the origin of levirate marriage.
A number of scholars maintain that the story does not refer to masturbation, but to coitus interruptus, and that the Bible does not claim that masturbation would be sinful." (from :Wikipedia about Onan)
Let us test the Word of the Scriptures together, and hold fast to that which is good, while dispensing of negative, burdensome, and fallible man-made traditions which can potentially block, hinder, and nullify the progression of His Truth which liberates us.
I do not believe that the Holy Spirit is grieved, quenched or vexed by masturbation at all, because the Scriptures hold up the Truth with clarity. There are MANY credible medical sources (and health magazines) out there which confirm the reality that masturbation is VERY healthy for the body and mind, produces numerous benefits which enhance vitality and livelihood.
Your body is the Temple of the Holy Spirit. Do your best to maintain it in good health, so that you will experience proper balance and harmony of your body with your soul and spirit.
Many Christians-Messianics believe that righteous masturbation is healthy and good for you, whether single or married, as long as it is conducted with self-control, wisdom and holiness, without going to any extremes, including lust, lasciviousness (lack of restraint by overindulging in excessiveness). As the saying goes : "All things in moderation..." Another expression goes : "Too much of any good thing will hurt you". In and of itself,...masturbation (just like marital intercourse) IS a divine gift to us who were created as powerful sexual beings.
Those who ignore the gift of sexual release (in a proper and holy manner, while abstaining from lust towards a non-spouse/outside of marriage) are only hurting themselves physically, emotionally, mentally, etc. Those who use their Yahweh-given imagination and physical abilities can experience true release and rest (which follows).
A single person can 100% avoid lust/adultery by righteously fantasizing about an imaginary partner (who does not exist). A married person can fantasize about their spouse during brief periods of intercourse inactivity. This helps prevent the tension and frustration from building to an uncomfortable point and causing further dysfunction. Our heavenly Creator has given us this ability, and we should use it to our express benefit and blessing, just as He intended, when He created us with arms perfectly lengthened with hands (and opposable thumbs) which reaches our private area with excellent accuracy. This is divinely-planned, and nothing is coincidental.