In my experience, changing the law to forbid religious discrimination did change things in Ireland and it was for the better.
In all these cases, there are a hard core of people who disagree and who break the law. But there is a solid majority who aspire to obey that law and it changes their behaviour. Take away the law and behaviour will revert to the bad way things were.
Did you even read that article?
It wasn't just "legal", it was officially sanctioned. It was enshrined in law. And I'm not talking about 1964. I'm talking about today. In today's society, do you believe that racial segregation would again achieve dominance without official sanction?
There is more to the world than the state of Alabama. I grew up in a segregated society in Ireland where there was no legal basis for it. The same (I think) applies to Barry Goldwater in Arizona.
Read the entire article. It reinforces the point that laws do change people's behaviour. Law sets a standard of behaviour that the majority of people aspire to.