I really think that written laws can shape norms over time (though they're usually the result of changing norms themselves, blah blah blah). The slave code and later Jim Crow reinforced racism just as civil rights legislation made it taboo.
Not that the point of civil rights laws was to stop people from having racism in their hearts. It was to let black folks get entry to mainstream American society, by making sure they had access to education, employment, public accommodations, legal representation, the ballot box, housing, etc. Even if white people continued to be secret bigots, that's a pretty f'n big deal.
A lot of libertarians/Paul apologists talk about how racist businesses would eventually be at a competitive disadvantage (either through boycotts or through losing out on potential black customers and employees) and be forced to change by the market. But there was a century after the Civil War and before the CRA and this didn't happen. There was even roughly three decades after Reconstruction before Jim Crow laws started being passed, so you can't blame it on statism.
This always depresses me a bit. I know that there's a temptation to spout off on subjects we're not that familiar with in order to buttress our own worldviews (I plead guilty), but America's struggles with institutional racism are recent and important enough that it feels like a disservice whenever they're used that way.
When you force equality it doesnt work that well. People in America are far more racist than people in Australia or Europe.
Speaking of which, you clearly have no clue about racism in Europe/Australia or the attendant debates on hate speech laws.