We're reffering to the same quotation. Marx is referring to religion as a tool to make people feel better about their lives in order to keep the established order, much like opium keeps people calm and relaxed.
And I'm not saying that this wasn't how Marx saw the social function of religion. I think, though, that this particular passage might be seen as expressing a more positive attitude towards religion, or at least a less fierce condemnation, than that usually associated with it; while, according to such interpretation, religion could be seen as a reaction to socio-economic conditions and a tool eployed by the ruling class over the people, it wouldn't necessarily exclude its more positive aspects.
And to address your point - while I'm not saying that religion might not be used in such way, I think some religious movements could be seen as having an aspect critical, opposing or not upholding the socio-economic environment (e.g. the Liberation Theology), thus not necessarily being
a tool to make people feel better about their lives in order to keep the established order.