Marx wrote in the Contribution to the Critique of Hegel’s Philosophy of Right that religion “is the opium of the people.” By this he meant it was a tool of ideology used by capital to enslave and narcotise the proletariat. It was part of the superstructure, the cultural components of a society that were part of the armamentarium of oppression that capital used to pursue profit and commodity fetishim.
During American chattel slavery, religion was used as a means to insure slave compliance. Slaves were promised their heavenly reward if they would accept and obey current rules and conditions of the peculiar institution. It is hardly surprising that religion like all other major institutions of a society is controlled by the ruling elites. Tithing, established churches, crusades, etc. were methods of class control fueled by religious activism.
Look at it from Marx’s perspective: He sees in Western Europe, primarily in Britain, an almost indescribable world of proletarian misery and dysfunction. Therefore, all institutions, law, religion, art, letters, press, medicine etc. are seen as tools of class domination. These are components of the superstructure that rests on a base or substructure of economic forces that determine the fate and eventual revolutionary direction of a given order. To Marx, religion was not central but merely an appurtenance, a tool, in which dominant economic classes ruled over their subalterns.
Certainly one can identify in American history, the use of religion as a progressive force as well. The clergypersons who ended American apartheid in the 1950s and 1960s were motivated by Christian love and a religious inspiration to end Jim Crow and American racism. So Marx’s ideas, while arresting and certainly significant, can be used in a comparative sense to either confirm or to contest his conclusions.