God slew Onan because the man contemptuously refused to fulfill his familial responsibility under the Old Covenant. This particular practice is called levirate marriage, in which a dead man's closest unmarried male relation (usually a younger brother, as in this case) married the widow to produce an heir for the dead man. This duty is spelled out in
Deuteronomy 25:5-10 to preserve tribal inheritance rights (verse 6). Another, happier circumstance of levirate marriage is recorded in the book of Ruth, an event that eventually produced Israel's greatest king, David (
Ruth 4:17).
Catholic doctrine uses Onan's story to prohibit the use of birth control. However, this is specious reasoning, based on an ancient and flawed notion that sexual relations between a man and his wife are only for the purpose of producing children. God's anger against Onan had everything to do with his failure to fulfill his covenantal obligation, and nothing to do with his method of birth control. Scripture does not directly contemplate the use of birth control, and thus, aside from abortion, it is a matter of personal preference within what God has revealed as proper Christian living. We can be guided by the principles of personal responsibility—
stewardship of one's resources to provide for children (
I Timothy 5:8)—and love toward one's mate (
Ephesians 5:22-33).