Earlier quoted context omitted.
But laws are just encodes morality.
Absolutely not. It was illegal to harbour escaped slaves. Or hide Jews from the Gestapo. Laws have nothing to do with morality. Or justice.
But they all reflect the morality of society to a degree, whether the democratic majority, or the powerful minority.