If God does not exist, then praying and worship is a waste of time, and therefore an evolutionary disadvantage. However, we observe that most humans are religious. So, logically, God must exist.
Why is it a disadvantage? Arguably, religion provided the cohesion that enabled cultures to form. The collective will of a society is preserved and propagated through ritual so that the group may endure even as individuals fall. That's actually a pretty huge advantage. It's similar to the power of the collective of Internet users; we are stronger together. We are held together by memes or whatever, and other groups are held together by rain dances or group prayer or whatever else they do.