Laws are not immutable. Slavery is an example of something that was lawful and then society added rules against it.
society literally had to break down for years in order for us to add rules against it
https://en.wikipedia.org/wiki/American_Civil_War
In US, the society didn't just "add rules against it". If you recall, the slavers first had to be beaten with a very big stick.
and your point is?
society literally had to break down for years in order for us to add rules against it
https://en.wikipedia.org/wiki/American_Civil_War