Onanism is a term commonly employed as a synonym for the act of masturbation or sexual self-gratification.
The word is named after a Biblical character, Onan, the son of Judah who refused to impregnate the widow of his slain brother, Er. The story is narrated in Genesis 38:7-10.
But Er, Judah’s firstborn, was wicked in the LORD’s sight; so the LORD put him to death. Then Judah said to Onan, “Lie with your brother’s wife and fulfill your duty to her as a brother-in-law to produce offspring for your brother.” But Onan knew that the offspring would not be his; so whenever he lay with his brother’s wife, he spilled his semen on the ground to keep from producing offspring for his brother. What he did was wicked in the LORD’s sight; so he put him to death also.
Even though it is clear from the text that Onan engaged in coitus interruptus rather than sexual self-stimulation, some commentaries and schools of thought have used this passage to teach that by spilling his seed outside the woman, Onan engaged in masturbation which made God strike him dead.
While the act of masturbation is not specifically mentioned in the Bible, it is still a sin, because, it falls under the category of sexual lust; it’s often accompanied by pornographic materials (whether visual or mental imagery) and it fails the 8 basic tests of Godly purity (Matt. 5:28, Phil. 4:8).
To understand why God killed Onan for his failure to impregnate Tamar, we need to consider the context of the story which was the tradition of Levirate marriage. To this end, I quote some Bible scholars who explained the cultural context of this passage more clearly:
“Levirate Law: (from Lat. levir, ‘brother in law’; the Hebr. term is yabam, ‘to perform the duty of a brother-in-law’). If a man dies without bearing offspring, his widow is to marry the deceased brother (her levir). A child born of that union is considered to be perpetuating the ‘name’ (lineage, honor, and inheritance) of the deceased (Deut. 25:5-10). Such a practice is common in traditional societies, promoting social and economic stability. Refusal to fulfill this obligation results in public shame (Deut. 25:9-10), because it indicates a greater concern for one’s personal welfare than the welfare of the extended family” (eds. Bruce Metzger and Michael Coogan, The Oxford’s Companion to the Bible, Oxford Univ. Press, 1993, 434)
“It refers to the levirate law of antiquity (the Latin levir means ‘a husband’s brother’) … Here and elsewhere (Deut. 25:6; Ruth 4:10), it is for the preservation of the dead brother’s name and family. In addition, the law is one of inheritance so that the dead man’s property will remain in the extended family. Finally, it is for the protection of the widow so that she should not have to sell herself for debt or have to marry outside the clan” (John Currid, Genesis, Evangelical Press, 2003, 2:209)
“Onan apparently does not want to father a son who will prevent him from receiving his deceased brother’s inheritance.” (Victor Hamilton, The Book of Genesis: Chapters 18-50, Eerdmans, 1995, 436)
“Onan’s refusal is explained by his knowledge that the son will not be his (38:9). We need to recognize, then, that there is a birthright issue here. Er was the firstborn and entitled to the birthright. If he had no offspring, the birthright will transfer to Onan. If, however, Tamar bears a son that is considered Er’s, the birthright will pass to that son. We can therefore conclude that Onan is punished by death for preserving his inheritance rights by disposing of the competition” (John Walton, Genesis, Zondervan, 2001, 668).
Onan’s sin was obviously a wicked selfish motive to keep the inheritance, rather than to sexually please himself. To relate Onan’s sin to the act of masturbation, will have to be an extrapolated interpretation. It was the refusal of Judah to give Tamar another son for marriage, due to his fear after losing two under God’s judgment that propelled Tamar to disguise as a prostitute so as to conceive for Judah (Gen. 38:11-26).
When one considers how this story has been misapplied to induce an overwhelming guilt and legalistic jive, it then becomes clear why one needs to properly understand the historical and cultural context of a Bible passage before venturing to use it.