"...Man, who looked for a superhuman being in the fantastic reality of heaven and found nothing there but the reflection of himself, will no longer be disposed to find but the semblance of himself, only an inhuman being, where he seeks and must seek his true reality.
The basis of irreligious criticism is: Man makes religion, religion does not make man. Religion is the self-consciousness and self-esteem of man who has either not yet found himself or has already lost himself again. But man is no abstract being encamped outside the world. Man is the world of man, the state, society. This state, this society, produce religion, an inverted world-consciousness, because they are an inverted world. Religion is the general theory of that world, its encyclopaedic compendium, its logic in a popular form, its spiritualistic point d'honneur, its enthusiasm, its moral sanction, its solemn complement, its universal source of consolation and justification. It is the fantastic realisation of the human essence because the human essence has no true reality. The struggle against religion is therefore indirectly a fight against the world of which religion is the spiritual aroma.
Religious distress is at the same time the expression of real distress and also the protest against real distress. Religion is the sigh of the oppressed creature, the heart of a heartless world, just as it is the spirit of spiritless conditions. It is the opium of the people.
To abolish religion as the illusory happiness of the people is to demand their real happiness. The demand to give up illusions about the existing state of affairs is the demand to give up a state of affairs which needs illusions. The criticism of religion is therefore in embryo the criticism of the vale of tears, the halo of which is religion."
Karl Marx, "The Introduction to Contribution To The Critique Of
Hegel's Philosophy Of Right" 1844
What will really twist your noodle, though, is that I can agree with all of this yet still see value in religious practice as part of the expression of a people's self-identity.