Currently for me it holds no purpose but in the past it was about Control and Comfort. It would be naive to hold the belief that different versions of religion didn't play an important part in keeping many groups of people together past the original idea of "Hey if we work together we can grow more or we can take that guys stuff from him" Having a common ideal or belief is a strong force and it does make it easier to form society. Its easier for a society to rationalize that it’s right to take whatever actions it takes or to comfort themselves by explaining things they don't understand via magical forces and to establish authority to rule. It’s very helpful to control a mass of uneducated people to do what you need if they have a fear of a god in them. Religion however is its own undoing because of some of the long term benefits of having united causes allows a society to focus on more problems leading to a few people who start question faith after learning more and more. Yes religion will attempt to hold back advancement at a point for its own self preservation but it fails in keeping the flood gates closed forever.