Genesis 38:10 NLT

10 But the LORD considered it a wicked thing for Onan to deny a child to his dead brother. So the LORD took Onan's life, too.