text: The answers goes back many centuries.  In the past there was a  HUGE risk of miscarriage and death during birth due to poor medical practies.  Due to this birth rates were very low and there was a legitimate threat of a society dying out.  Religion, then, as it does now, attempted to fix a societal problem by outlawing masturbation in the hope that if they outlawed masturbation people would be more interested in the opposite sex, would have more sex, and hence create more babies, alleviating the concern that a population crisis (too few) would ensue.