Laws for morality do not change the heart.
They enable enforcement of justice and in some cases, where the death penalty is applied, yes, does cause a reduction in law breaking by reducing recidivism and maybe action as a deterrent for some kinds of crime.
But morality comes from within and cannot be legislated. Laws mostly enable the application of justice when they are broken.
Well said. Laws aren’t a guarantee against evil-doing. They are society’s way to say here’s the line, don’t cross it unless you want to face the consequences.