Sometimes I wonder how something made it into the Bible in the first place...
Genesis 38, the story of Judah and his daughter-in-law Tamar
Background Judah's firstborn son Er was bad in Jehovah's eyes, so Jehovah put him to death. Genesis 38:6
So Judah being the good father that he was gave Tamar to his second son to have sex with and have children in the name of the fallen Er... we pick up reading in Genesis 38:9
"(9) But Onan knew that the offspring would not become his and it occurred that when he did have relations with his brother's wife he wasted his semen on the earth so as not to give offspring to his brother. (10) Now what he did was bad in the eyes of Jehovah; hence he put him also to death."
Now Judah was supposed to give his last boy Shelah to Tamar, but didn't and long story short, Judah got with Tamar instead.
Why is this in the Bible? What moral lesson are we to learn from this? Or is Jehovah just a pervert?