I think you are forgetting that laws are responsible for a good chunk of what people perceive/are educated to see as good/wrong honest/dishonest.
Sure the worst atrocities are known to be bad from Religion (10 commandments, which is a law in itself) but many aren't. Speeding, drunk driving, harassment aren't concept that are obviously wrong (as in obvious to people with no guardrails).
So laws aren't useless. The fact that most people respect them actually means they have a purpose.