All law legislates morality. The question is: Why?
It is one of the oldest and most important questions: How did we get our sense of right and wrong?
The believer's answer lies in Romans 2:12-16. Our sense of right and wrong was part of our Creation and therefore reflects the nature of our Creator. Thus, we all share that same moral sense and obligation (the rare sociopathic exceptions throughout history proving the rule).
But non-believers have no such logical foundation for our shared morality. So there is often an appeal to one of two hypotheses:
The first is that morality has evolved over time, and that we as humans have simply learned to "select" for the greater good through some kind of moral trial and error over the last 2000 centuries. But if that were the case, why do we have more laws today than ever before? Shouldn't we have already come a long way (or even some way) toward actually physically shedding our immorality as a species by now? To the contrary, the battle cry in this Postmodern Age is "My truth!", not "Absolute truth!", as we careen toward moral anarchy.
The second hypothesis is the appeal to "reason and science", which is basically just saying "I know because I know"; that if I apply the scientific method, employ enough algorithms, mine enough data, I can answer this and any other question satisfactorily. But this merely kicks the can down the road. Science and reason are not truth in themselves. They merely interpret truth, as do philosophy and religion. Thus, the question at hand remains:
Why do we know what is right and wrong?
Without God, I have no logical answer. You may disagree, but your answer must at least make sense.