And what did he do? He contracepted an act of intercourse.
You brought this idea to the passage, likely because Rome taught it. It is false.
I’m reminded, in light of other Old Testament writings, that it was considered a shameful thing for a woman not to conceive. That may also be the significance of the Scripture about not spilling seed.
Are you saying that Onan performed an act of normal, non-contracepted intercourse?