… is from pages 128-129 of Virginia Postrel’s insightful and still-vital 1998 book, The Future and Its Enemies  (bracketed remark and link added by me; footnote excluded):
The railroads, writes historian Edward Ayers , “neither wanted to police Southern race relations and then be sued for it nor to run extra cars [to segregate black passengers from white passengers]. It was clear that white Southerners could not count on the railroads to take matters in hand” by blocking or expelling black passengers from their first-class cars. “Some whites came to blame the railroads for the problem, says Ayers, “for it seemed to them that the corporations as usual were putting profits ahead of the welfare of the region.” The critics were mostly right. The railroads were not civil-rights pioneers but contract-bound, profit-seeking businesses for whom commerce was a “universal solvent.” Outraged southern legislators, who already resented the railroads’ economic power, passed laws requiring segregated accommodations. (It was one of these laws, passed by Louisiana in 1892, that the U.S. Supreme Court upheld in the famous “separate but equal” case, Plessy v. Ferguson.) Combining the technocratic lust to regulate business with the reactionary zeal to preserve social stability, Jim Crow laws imposed static definitions on a dynamic commercial culture inclined to treat customers as “colorless, odorless, and timeless.”
Robert Higgs’s remarkable 1976 volume, Competition and Coercion: Blacks in the American Economy, 1865-1914 , has more on the economics and history of the Jim Crow south. See also Jennifer Roback, “Southern Labor Law in the Jim Crow Era: Exploitative or Competitive?, “University of Chicago Law Review, Vol. 51 (1984); and Jennifer Roback, “The Political Economy of Segregation: The Case of Segregated Streetcars,” 46 Journal of Economic History, Vol. 46 (1986).