BC,
Pretend, for just a moment, that there is no god after all. Religions still exist, of course.
Now, if there is no god, what was the origination of the moral codes that became enshrined in religion?
The answer is obvious: these moral codes originated from human beings.
This is why atheists, as a group, are just as moral as believers (contrary to the bigoted ideas of some). Human beings carry within them the instinct towards certain behaviors. How could this be so, absent a god? Evolution provides the obvious answer: our human ancestors who were inclined to certain behaviors reproduced and survived at a higher rate than those who were not, hence, ensuring the continuation of these certain behaviors.
This not only explains our moral instincts, but explains why, despite claims to the contrary, human beings normally demonstrate a moral system called Tit for Tat, combined with reciprocal altruism. In fact, game theory has, indeed, demonstrated that a group of humans who used this moral system would survive at a better rate than humans using other moral systems.
http://www.abc.net.au/science/slab/tittat/story.htm
You really should read the link. It's fascinating.