Herb Silverman, the president of the Secular Coalition for America, has a piece on the On Faith blog about the Catholic Church and their misguided views on sex.
You can learn about when and why the Church created its rules about sex.
Celibacy didn’t become Church law until the Second Lateran Council in 1139, when every priest’s marriage was declared invalid and priests were ordered to separate from their wives. This was more about capitalism than spiritualism, since property that used to pass to the priest’s heirs became windfall Church profits.
Then to seal the deal against priestly sexual outlets, the Church prohibited all male masturbation. Pope Pius XI condemned this so-called sin of “onanism” because he misunderstood the biblical story. Onan was supposed to follow the levirate tradition of having sex with his dead brother’s wife to produce a child for his brother’s line, but Onan was punished for premature withdrawal because he wanted to become heir to his brother’s property. So Church law on both celibacy and masturbation involved the trading of sexual pleasure for real estate.
I would think the archaic rules could just as easily be reversed — it worked with Purgatory — But that would require breaking irrational tradition, something the Church has trouble doing.