Opium is a metaphor used to put down religion, saying that it does no good but sedates people and prevents people from thinking for themselves, and future progress.
Even for religion, the saving grace throughout the centuries is due to religious orders who do not succumb to the world's idealogy, but to the simple vows of poverty, chastity and obedience. It is those people who help us to stay on the path of righteousness.
Religion is not the "Opium of the Masses". Religion is suppose to be "glasses for the Masses" because it helps us to see the truth through the lens of faith.