Law doesn't do anything "magically." It does things by shifting incentives and establishing punishments.
You can't legislate bigotry out of a bigot, but you can minimize the suffering they cause other people. This is what anti-discrimination laws aim to do.
You can't legislate bigotry out of a bigot, but you can minimize the suffering they cause other people. This is what anti-discrimination laws aim to do.