Edward Feser offers some very sensible thoughts on the role of morality in law making:
Not all moral principles ought to be enforced by the power of government, but almost everything government does is based on some moral principle or other. It is fatuous, then, to hold that "we shouldn't legislate morality," if this means that controversial moral principles shouldn't guide public policy. And almost every moral principle is controversial to a significant extent: even when people agree that murder is wrong, they often disagree about what counts as murder, as the disputes over abortion, euthanasia, and even the killing of animals attest. The question, then, is not whether controversial moral principles ought to inform our laws, but rather which controversial moral principles -- liberal, conservative, libertarian, or whatever -- ought to inform them.