Genesis 38:7-10 (KJV)
But Er, Judahs firstborn, was evil in the sight of the LORD, so the LORD took his life.And Judah said unto Onan, Go in unto thy brother's wife, and marry her, and raise up seed to thy brother.
And Onan knew that the seed should not be his; and it came to pass, when he went in unto his brother's wife, that he spilled it on the ground, lest that he should give seed to his brother.
And the thing which he did displeased the LORD: wherefore he slew him also.
If brethren dwell together, and one of them die, and have no child, the wife of the dead shall not marry without unto a stranger: her husband's brother shall go in unto her, and take her to him to wife, and perform the duty of an husband's brother unto her.And it shall be, that the firstborn which she beareth shall succeed in the name of his brother which is dead, that his name be not put out of Israel.
And if the man like not to take his brother's wife, then let his brother's wife go up to the gate unto the elders, and say, My husband's brother refuseth to raise up unto his brother a name in Israel, he will not perform the duty of my husband's brother.
Then the elders of his city shall call him, and speak unto him: and if he stand to it, and say, I like not to take her;
Then shall his brother's wife come unto him in the presence of the elders, and loose his shoe from off his foot, and spit in his face, and shall answer and say, So shall it be done unto that man that will not build up his brother's house.
And his name shall be called in Israel, The house of him that hath his shoe loosed.
It wasnt just a matter of failing to fulfill the Levirate obligation, because the punishment for that is described in detail in Deuteronomy 25: 5-10: it consists of a public insult: the woman can take off the sandal of the man who refused to impregnate her, and spit in his face.
That's it: public disgrace of the man at the city gate.
But Onan was not just given public disgrace: God judged him worthy of death.
Why? Because it wasn't just his refusal of his Levirate obligation-- that only merited a public shaming --- but the WAY he did it: by performing a perverted, contracepted act.
That's why God slew him. God thought this was detestable.
The point is this: for 1900 years, all Christians---Protestant, Orthodox, Reformed, Catholic, Evangelical, all of them--- understood God's law as forbidding any kind of intentionally sterile sex, including both Onanism and Sodomy.
Now, since 1930, most of them ignore, have redefined, or have accepted, Onanism.
BTW, that's not a "development of doctrine." That's a rejection of doctrine.
Give them another 15 years, and most of the contraceptors will redefine Sodomy as well. Many of them already have, because morally they're closely related: both sodomy and contraception are the rejection of natural fertile sex, and the choice of something other than natural fertile sex.
That's not just a "slippery slope," it's a logical four-lane highway.