And this itself is based on a willful misinterpretation. Onan wasn’t killed for “spilling the seed”, it was for disobeying God’s law that requires a man to impregnate his brother’s widow if they don’t have any heirs. He felt that fucking his brother’s wife (while he was still married to his own) was wrong. His real crime was putting his own morality above God’s.
Of course, since many Christians would agree with him on the merits of widowed-sister-in-law-fucking, they tend to ignore that part.