Ok, so how about slavery. Or eugenics laws in the 1930s. Or Jim Crow. Or anti-sodomy laws in the US. Or women not being allowed to vote. Or like, any, of the literally thousands of horribly immoral laws that have been on the books in literally every country on the planet.