God/Allah/Buddha/whatever gives them someone to blame other than themselves..someone to to praise other than each other..
It also gives them someone to turn to, when they feel down, someone to believe in when they don't believe in themselves and someoe to calm them down and reassure them when they are afraid. In those situations it can be a great psychological/mental tool, actually. I'm talking about religion as a personal belief and something completely private here, not about organized institutions.