What you say here about law reminds me of warring positions around that very thing:
“Legislation is powerless to eradicate racial instincts or to abolish distinctions based upon physical differences.” Plessy v. Ferguson, 163 U.S. 537, 551–52 (1896) (Douglas, J.)
“It may be true that the law can’t make a man love me, but it can restrain him from lynching me, and I think that’s pretty important also.” ~Martin L. King, Jr. Speech at UCLA, 1965. See Jordan Ballor, The Hearts and Habits of Men: MLK on L:aw and Morality for The Life of the World, https://alumni.ucla.edu/ucla-history/ucla-history-2/ (last visited June 12, 2020).
King nailed it.