Problem: Why did God kill a man, Onan, for spilling his seed on the ground as recorded in Genesis 38:9? Is that really worthy of death? The answer lies in the legal custom of the time. He refused to carry out his familial obligations of producing offspring for his brother. As odd as that may sound to the modern ear, in that culture, relatives needed to produce seed for a deceased relative under certain circumstances. Onan didn’t, and God killed him.
Solution: Genesis 38:9, “And Onan knew that the offspring would not be his; so it came about that when he went into his brother’s wife, he wasted his seed on the ground, in order not to give offspring to his brother.”
The levirate obligation in the law of marriage is the basis for this practice, and to disobey it, was to disobey God. Now, we must realize that the culture was very different from what ours is today. In that culture, when a man died and left no children, the next of kin was sometimes obligated to “go in to” the wife of his brother and produce children. This is significant because they believed that a man’s seed was what produced children and that a woman’s womb was the place the seed grew. This is much like the idea that the seed of a plant could be sown almost anywhere, and it would grow. Therefore, the children thus produced were then considered the original late husband’s descendants and would be raised as such. This way, the offspring would be able to take care of the mother, provide more people for the community, and raise their own children – continuing the name of that family. Onan knew this and refused to furthering the honor and name of the brother’s wife and thereby also risking provision for her in the future. To this, God was very displeased and took Onan’s life.