(Genesis 38:9) – “And Onan knew that the seed should not be his; and it came to pass, when he went in unto his brother’s wife, that he spilled it on the ground, lest that he should give seed to his brother.”
Why did God kill Onan for spilling his seed on the ground? The reason God did this is not because Onan wasted his seed on the ground, but because Onan refused to perform his familial duties of producing offspring for his brother’s. This was a great offense at the time. Now, we must realize that the culture was very different than 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 and produce children. These children were then considered to be the descendents of the original late husband 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 thereby raise their own children, continuing the name of that family. Onan knew this and refused to take part in 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.