The main role of religion throughout history has been to keep society well behaved. But unlike spirituality, religion aims to enforce good behavior through programming and intimidation rather than true understanding, so the improvement of society came at the cost of ignorance.
Today, those who are spiritually smart can extract and combine the truths from any religion to increase their own wisdom, while those who join religions simply to belong to something end up swallowing and parroting a rigid belief system that they do not even understand.
But the worst purpose religion serves is to spiritually drain and enslave mankind. Whenever someone blindly obeys questionable sources of authority rather than listening to his own heart, part of his soul shrivels from neglect.
Whenever someone begs an external authority for strength and assistance rather than realizing that divine power is within, soul energy is lost to this external authority and it becomes harder to access the inner divine power.
Whenever someone believes something without experiencing, pondering, or intuiting it for himself and then goes around pushing it onto others, his ability to think new thoughts decreases and he becomes ever more robotic. Organized religion encourages all of these.
Religion & spirituality are two different things. Religion implies participation in a communal worship and agreement between a group of people about what God is. Spirituality is a one-on-one relationship and gives individuals autonomy over their interpretation of the soul/spirit.