The term "onanism," from the name Onan, has come to stand for masturbation which has suffered a fate similar to sodomy in the sense that it has evolved to have a meaning far different from its original usage.
Dictionaries define onanism as "male masturbation" or "Uncompleted coitus." According to interpretations of the Bible, Onan removed his penis from his partner's vagina before he ejaculated so that his seed fell onto the ground. This displeased God so much that he killed him! Onanism has also received a another definition of "self pollution" which has caused misery throughout the centuries. God killed Onan because, rather than to impregnate his brother's wife-- thus extending his line, Onan chose to interrupt his coitus before he could impregnate Tamar. Onan had a logical reason for doing so, one that involved Jewish law of those ancient days. During Biblical times, any child born to the wife of the eldest son died without heirs - and if his wife had no children sired by a relative of her dead spouse - then the dominance would pass to the second son. Onan stood to lose a great deal if he complied with his father's order. Had he been asked to marry his brother's wife, thus transferring her to his possession, he no doubt would have completed the act. Then the resultant child would have been his, legally as well as physically.
Some time during the centuries, the character of the sinful act was changed. Instead of being recognized as a seldom performed interrupting of coitus, it became accepted as any form of self-stimulation that resulted in orgasm, and the entire character of the deed became altered. Onanism came to mean a sinful act of masturbation! This has resulted in a general bad impression of masturbation even in secular beliefs. For example many a parent has told his son not to masturbate for fear of going blind.[I masturbated only until I needed glasses, Ed.]