It's pretty simple: a religion is a political entity first and foremost. By encouraging certain behaviors while making others taboo, you create an environment where groupthink and obedience is not only encouraged, but a measure of personal value. From there, you can control large groups of people with very little effort. Modern cults start with this, usually making certain rational behaviors (like contacting the police, contacting family members on the outside, contacting mental health professionals) taboo. See also: Scientology.
Religion, in particular, attaches morals to sexual encounters because one tactic of fighting against other tribes and sects is simply to outbreed them. It's especially important if your population is low compared to the other sects/groups you're competing with, and you're surrounded by them. The modern Quiverfull movement is an example of this mentality. Sex must be orderly, and primarily slanted towards reproduction, in order to be useful for the group at large.
So, yeah, it's no great mystery. If you view organized religion as the political apparatus it's always been, a lot of things start to make sense.
Religion, in particular, attaches morals to sexual encounters because one tactic of fighting against other tribes and sects is simply to outbreed them. It's especially important if your population is low compared to the other sects/groups you're competing with, and you're surrounded by them. The modern Quiverfull movement is an example of this mentality. Sex must be orderly, and primarily slanted towards reproduction, in order to be useful for the group at large.
So, yeah, it's no great mystery. If you view organized religion as the political apparatus it's always been, a lot of things start to make sense.
"I was thirsty for everything, but blood wasn't my style" - Live, "Voodoo Lady"