Elsie, i am surprised you would challenge this as if it were a new thing, and not search the matter out a little. This is nothing new, as the principle that martial vows end when one dies is why God commanded a brother to marry the widow of a brother. And as if the husband be dead then she is loosed from the law of her husband, thus "when David heard that Nabal was dead, he said, Blessed be the LORD, that hath pleaded the cause of my reproach from the hand of Nabal, and hath kept his servant from evil: for the LORD hath returned the wickedness of Nabal upon his own head. And David sent and communed with Abigail, to take her to him to wife."(1 Samuel 25:39)
The sin of Onan was quite evident to be selfish disobedience to God.
This might be true; but where is it recorded?
Did GOD tell Juda to tell him?
Juda, therefore said to Onan his son...
IF I live by sticking to the Scriptures...
It appears that Onan died because he dishonored his father's command.