Religion has always been a tool that allowed people to grok the world around them. I think like the abacus, or the sun dial, or many other tools it's usefulness in that capacity has faded as far as science goes, but it was a major driving force in people's lives for a good long time. Of course, the corollary of that is that it has also led to many of the WORST moments in human history. Whether you're talking about the ritual sacrifices of the Aztecs to Huitzilopochtli, or the brutality of the crusades, or the modern example of the terrorist attacks of 9/11.
I think religion has basically been a force for good for most people because for most they found a road map of how to live your life well, and generally it would be liberally peppered with concepts such as caring for the poor, kindness, love, (some religions weren't quite as interested in those concepts of course) and many other good qualities, along with a series of injunctions and prohibitions against concepts that often seem arbitrary and incoherent in modern societies. And yet, those belief systems, despite apparent structural flaws when held up against modern moral codes generally saw societies that were quite prosperous and stable in their day. I think it's becoming increasingly anachronistic but I'm not going to deny the fact that religiosity has generally done a good job in serving humanity well.