I have heard the argument that religious morality arises when human groups become big enough to grant anonymity to individuals. When individuals can't keep track of everyone in their community it becomes important that everyone internalize's the communities ethical and moral standards of behavior.