I recently come across an article on Freud which comes very close to some of the theories/ conclusions Ive had myself, about the origins of religion. (I have included some of it below.)
To me, in ancient times when people were very superstitious and didn't understand the world as we do now, they attributed it to something they could relate to. So it was natural when lighting struck their fields and burnt them down, or there was a flood or famine, or all their livestock died- to look up into the sky and feel there is some higher power doing it to them.
Thus they would seek to appease this higher power and it developed into a relationship similar to the one they had as children, with them trying to please their parents so the parents would treat them kindly and protect them.
And their parents would instill on them the laws and ideals of the civilization they came from. And for any community to work, people are basically good to one another, do what benefits all members and try to fit in.
With this combination of giving nature and things we dont understand a divine slant- plus a paternal manifestation- it is only natural when we created these gods, deities and spirits of our very first religions, we believed that in order to stay on their favorable side we had to behave.
And so when the first men began to write their religions down and to have 'visions' etc they actually came up with a set of rules that did infact teach people to be good and love thy brother etc.
Exactly like your parents told you.
Eventually, just like 'my dad is stronger than your dad,' when opposing civilizations with their own paternal gods met up, it became a matter of the strongest religion surviving.
An example of this is the Christian ONE God versus the old Roman Pantheon.
The reason Christianity superceded the Roman gods, despite it being an outlawed religion punishable by torture, lion feeding and crucifixion was because it taught that every man was equal. And it also taught that women were equal aswell.
It put all humans on an even level; the emperors, senators and wealthy merchants were all seen as equal to the slaves, the workers the homeless, and the women
, in the eyes of the ONE Christian God. (Whereas the roman gods of the time were fickle and capricious and only seemed to favor those in power.)
It's not surprising that when humans need this belief in a paternal figure who commands the universe, that the majority of people would eventually find the Christian god more appealing, since this god loved all his children with equal fervor.
This is just one explanation into how and why people created religion.
Then of course there was the inevitable corruption of these ideals which Mugen has brought up. You are right about religion becoming a tool for those in power.
If you look at the history of the Roman Catholic Church over the centuries you will clearly see that it went off the path.
Like the saying goes: Power courpts. Absolute power corrupts absolutely.
Having the power of God on your side to get others to do your will would be a great temptation.
And another saying that comes to mind is: Religion is the opiate of the masses.
For Freud the raison d'Ítre of religion is to defend us against nature by removing the terrors, etc. of nature. For example, the personalization of nature offers to humanity a way of understanding what it is we are so powerless over. This also permits the development of some form of control over nature. Thus it is through "sympathetic magic" that humanity comes to gain a feeling of some kind of control over nature.
Freud suggests that it is natural for humanity to personify nature and the like as humans know from the beginning that the way to influence nature is through the establishment of relationships. Thus, when he growing child learns that he or she is to remain powerless forever (a child), dependent upon superior powers forever, he or she lends to this divine figure the powers that belong to the parent.
Once divinity has been given such attributes, Freud follows, everything that occurs is understood by humanity to be an expression of an intelligence superior to us and death is no longer seen as the extinction of life. Rather death is seen as but the beginning of a new kind of existence which lies along the path of development to something higher. This view, thus, announces that the same moral laws of civilization, also govern the whole universe.
Hence there evolves an understanding of a kind of superior wisdom which directs the course of things, an understanding of a superior goodness and justice . . . From this point of view . . . humanity's relation to the divinity come to recover the intensity and intimacy of a child's relation to her or his parents.
But, Freud notes, the role of the Gods and Goddesses has over time evolved away from their relationship to nature (the divinities and nature have become autonomous of one another). Thus it has become the task of the divinities to even out the defects and evils of civilization and to attend to the suffering which we inflict on each other.
To Freud the historical truths put forward in religion have become so distorted and systematically disguised that the mass of humanity cannot recognize them as truth. He compares religion to the practice of telling children they were brought by the stork.