The better question is how can a society NOT legislate morality. A wise man once said that “every law contains a ‘should’ or ‘should not.’”. That’s the definition of morality. And it’s present in every law, regulation’ and ordinance we pass.
The issue then becomes WHOSE morality gets encoded? Is it the majority’s or that of a small but very vocal minority?
I think you need to dig deeper than “ law” to define morality
In ancient times the law could order families to offer their firstborn to the fires of moloch - for the common good of course
Excellent answer! (Saw this after I replied to Silver Leaf.)