Onanism is an act Onan committed when he was commanded by God to fulfill his brotherly duties with his dead brother's wife under the rules of Levirate marriage. Onan circumvented the process of reproduction. Onan was killed by God for committing his disobedient act (Genesis 38:7-10).
Whether the act of onanism is a sin is subject to dispute, as onanism is a commonly used birth control method also called coitus-interruptus or withdrawal. The Roman Catholic Church and other popular sources interpret this passage as a condemnation of sexual intercourse which does not permit reproduction. Thus, the Roman Catholic Church considers onanism (including masturbation) to be sinful, because it says, " 'The deliberate use of the sexual faculty, for whatever reason, outside of marriage is essentially contrary to its purpose.' For here sexual pleasure is sought outside of "the sexual relationship which is demanded by the moral order and in which the total meaning of mutual self-giving and human procreation in the context of true love is achieved.". The traditional Jewish view of the Biblical passage suggests that Onan's sin may have been in disobeying an order from God, or even the lack of putting the family needs before his own.