Suppose a hypothetical business's customers are 80% white and 20% black. This business is located in a place where many white people are racist. Further suppose that these racist customers are opposed to the idea of eating in an integrated restaurant. Thus, the self-interested business owner makes a calculation that enough of his customers (and the local population) are racist that he might be able to win more business by excluding black people from his restaurants--because he'll gain more favor with those racist customers. And whatever small minority might be offended by it (i.e. the more egalitarian-minded white people) and the minorities themselves, will be too small to offset his gains. If his math is right, and it may well be if racism is popular enough, this might make business sense. (Of course, if by contrast, the amount of the population that is virulently racist is relatively small, then discriminating on race would be counterproductive, even in amoral economic terms.)
It doesn't really matter whether the owner himself is racist or not. The decision will, or will not be economically sustainable based on the opinions of the public in general, regardless of the owner's own views.
So based on the above story, we must concede that it is possible that discrimination could, under certain conditions, make business sense. I'm not sufficiently familiar with how quickly opinions evolved in the South, so I won't claim to know how long this remained economically feasible. For these purposes, it is enough to acknowledge that is a possibility. So the question becomes, what happens to the minorities? Will there be any businesses to serve their needs?
And the answer is obviously yes. Indeed, the discrimination of the businesses, means that minorities would be an untapped market that would be easy for the entrepreneur to gain as customers. They might devise a business that caters exclusively to the needs of those minorities, or, more likely, they might make an integrated establishment that could attract a wider range of customers. Assuming the latter, over time this second business would also be sustainable. If we further assume the general trend that younger generations tend to be more tolerant (at least of race, gender, etc.) than their parents continues, then this second business would become more profitable in the long run, and the discriminatory business would eventually have to change its ways as its customer base shrinks. Even if we assume no change in tolerance over time, it's still the case that the business serving minorities should be able to do so properly. Discrimination might exist in this case, but no one is being denied access / underserved.
Logically, this story should make sense as long as we assume (at least some) people are motivated by self-interest. And while the more pessimistic edition (where discrimination is sustainable) may not be ideal, it still avoids the most important problem of minorities being frozen out of the market.
But there seems to be a problem with this story. Because obviously, discrimination really did exist in a major way in the American South. America has a free market, and yet Rosa Parks was still discriminated against on the Montgomery buses. How do we account for this? Surely we must have gotten something wrong in the story above if the free market produced such an outcome?
This is the cognitive dissonance that people naturally face when they hear the economics case against antidiscrimination laws. It doesn't seem to conform to the historical reality we learned about.
Fortunately, there's a quick article by economist Thomas Sowell (who happens to be black, if you find that relevant), that helps us reconcile these conflicting ideas. Sowell's piece focuses on the famous Montgomery Bus Boycott episode. He explains that, in fact, the state government passed the laws that required the private bus operators to segregate their buses--and business owners actually unsuccessfully lobbied to block the legislation because they didn't want to lose the business of the minority customers (and most of their white constituents were indifferent).
In other words, Sowell's article suggests that, at least in this prominent case, the free market did not produce a discriminatory business model. In fact, the government required discrimination, and self-interested business owners tried to fight it. Sowell also offers an excellent summary of why the market process fights discrimination while the political process encouraged it (emphasis mine):
Rosa Parks and History
These [private bus company] owners may have been racists themselves but they were in business to make a profit -- and you don't make a profit by alienating a lot of your customers...
People who decry the fact that businesses are in business "just to make money" seldom understand the implications of what they are saying. You make money by doing what other people want, not what you want.
Black people's money was just as good as white people's money, even though that was not the case when it came to votes.Here's a link to the rest of the piece, which I highly recommend:
Rosa Parks and History