But most religion is corrupted spirituality. You see every human has Ego (self-concern) which is the heart of selfishness and separateness.
Religion, the closer it is in history to its founder, typically generates a boom of spiritual good, bringing people together for the common good.
Christianity helped to reduce the damage from the Middle Ages and kept alive much of the learning that would otherwise have been lost. Churches kept channels of communication open across "Dark Age" Europe.
Perhaps more importantly, religion helps to keep alive the flame of spirituality which is the only solution to suffering. Though corrupted, people still keep some interest in topics other than physical needs.
Other than that, religion has done a lot of damage to civilization, but that's only because Ego was involved. And Ego is involved in every aspect of civilization, especially the seats of power. One need only look at 9/11 to see Ego's signature -- the selfishness of the psychopathic elite to perpetrate such murder and then to blame it on Muslims so as to justify going to war in the Middle East. Slick, but sick.
Without the superior ideals of Love, Forgiveness, Inspiration, Faith and Creation, civilization might never have survived Ego. It would likely have slid back into the least common denominator -- a brutal fight for top dog -- the wailing and gnashing of perpetrator-victim.