I think you're right. In ancient societies, with constant tribal warfare and disease epidemics, the biggest challenge for any group was just to survive. The way wars were fought then, outnumbering your enemies meant beating them, so most ancient traditions condemn any non-reproductive sexuality.
The "Old Testament" Hebrew scirptures, for example, prohibit masturbation as strongly as homosexuality -- in both cases, sperm is being wasted that could be used to make more Jewish soldiers ... something very important in a region where the Jews, then as now, were dangerously outnumbered by the hostile tribes that surrounded them.
But in 2002, with six billion-plus humans alive, underpopulation is not exactly a problem, so hopefully we can be a little more tolerant of non-reproductive stuff like birth control., masturbation, and homosexuality.