There still are some strong taboo’s left in even in the open western societies, that even otherwise quite progressive people seem not to want to talk about in the open. One of them is masturbation. Nearly every single man does it in some point in his live, but normally nobody admits it.
The taboo is so strong that a person admitting to being a masturbator is quite universally rejected and shunned in public. This happens even if every single person doing this condemnation has done the same thing himself at some point of his life.

The origins of this strange taboo can be naturally extremely diverse. Our western cultures are, after all, patchworks of bits and pieces from all over the continent and even the whole world.
However, an undeniable fact is that the Christian religion still plays an immense role in how sexuality is perceived in western societies. First of all, Christianity has inherited from Judaism a extremely strict condemnation of all sexual activity that is not aimed at reproduction.

It has been theorized that the origins of this policy are in the early days of Jewish independent kingdoms. They were small with a small population and the Jewish kings wanted the population to grow as fast as possible. So, all such sexual activity that would not produce more babies needed to be made forbidden and taboo.
Christianity inherited this strange attitude towards sexuality like so many other strange ideas of Judaism. However, it has been said that the rise of Christianity brought a quite new angle into the question.

The key issue was not to enlarge Christian population through reproduction, when new converts were flocking in droves. However, according to a theory Christianity accepted the essence of Jewish sexual morality because the creators of the new religion wanted to please women. Women were after all often the real backbone of the new movement.
Christian church elders decided to ban masturbation and most of all forms of sex outside the marriage like pre-marital sex or prostitution and homosexuality. According to this theory early church wanted to please those women, who wanted the church to support the idea that sex could be had only through marriage.

In the open Roman society, other forms of sex were freely on offer. Some women could have felt that the lure of stable marriage would be diminished if other forms of sex than marital sex would be allowed.
The ban on pre-marital sex is naturally terribly old. It stems from the time of birth of agriculture and rise of the idea that land could be private property. The passage of land and other property that started to accumulate was strictly through inheritance. This new system of inherited property necessitated that the name of the father was known for certain, when in hunter-gatherer societies the need for this was not so central at all.
The ban on pre-marital sex stemmed also from the idea that having premarital sex would make girls less valuable as sellable items. It could even damage them as goods that were to be sold to men.

Pablo Picasso. Les Demoiselles d'Avignon, 1907 - Wikipedia

According to a theory, the ban on masturbation was just part of the overall drive to make permanent marriage more luring as the only possible source of sex. Of course, this strategy has always worked badly. Also in all Christian societies there has been prostitution, pre-marital sex and most men have masturbated.
However, this has not been so bad for the church at all. When one bans all possible forms of sexuality including having even sexual thoughts from young men, one can be quite certain that they will break these bans. Whey these young men have been taught to acquire a strong sense of guilt for breaking the bans, the strategy works just well for the church.

This strong sense of guilt is the base on which Christian religion builds one of its main strategies. It simply says to these young men that only it can forgive them from their terrible sins like sexual fantasies or masturbation.
On the other hand, this forgiveness will be forthcoming even after inevitable new offenses. However, this forgiveness can be had only if the message of the church is swallowed as a whole without questioning it in any way.

Christian churches have succeeded in making hundreds of millions of men fear sex and even hate themselves and their bodies, when it has made extremely normal bodily functions like masturbation into something dirty.
Masturbation has been seen even as something evil that must be fought against at all costs. This as lead to even mutilation of penises of small children.

The idea did spread that circumcision can make masturbation more difficult. At some point even majority of American Christian males were circumcised in a desperate act in the fight against masturbation.
This all has happened even if no causal relationship is known between masturbation and any form of mental or physical disorder. Alfred Kinsey's studies even in the conservative 1950s on US population did show that 92 per cent of men and 62 per cent of women have masturbated during their lifespan. (Wikipedia: http://en.wikipedia.org/wiki/Masturbation)