Marx famously referred to religion as the opiate of the masses. And in many ways, he was right about that. However, his real problem wasn't with religion per se, but with religions who were in competition with his own Marxist religion. For him, the problem with an institution like the Catholic Church wasn't that its followers possessed faith in the divine, its problem was that it took followers away from Marx's God, the state.
Just a theory, of course.