This is an important point that those in disagreement with these kind of arguments often under-emphasize or ignore entirely. When a government makes it illegal to behave in a racist way, the racists don't go away, and they might even be amplified within those communities in a similar way to the Streisand effect.
If everyone in a community is racist, you can't simply make it illegal to be racist to fix the problem. They have to make that decision on their own - anything else is fundamentally authoritarianism, which doesn't have a great history of long-term success.