"You can't legislate morals!" Well, of course you can, and we do, and most of our laws have some moral component to them. But the claim persists. Underneath its obvious error, there's some truth in there somewhere.
Continuing my meditations on Jonathan Haidt—purity/sacredness is a cardinal difference between our liberal religion and their conservative religion. Liberals and conservatives agree that justice, rights and autonomy are part of morality, and that care of the weak is part of morality. But we split with them over purity and sacredness.
Our culture-wars are mostly fought over issues of purity and sacredness. Flag burning. Obscenity. Sex toys. Drugs. Adultery. Homosexuality. Gay marriage. (Abortion is an outlier. It hits at least as strongly along the care of the weak and the rights/autonomy axis. But sexual purity is a big component of that argument.)
Underneath the (dubious) claim "You can't legislate morals" is a more narrow truth. In a free society, in order to legislate morals, you must have at least a rough consensus. For the morals of purity and sacredness, that consensus is elusive.