I think that's an oversimplification of Law and Society.
Heinlein was basically a Libertarian and, while not a complete libertairan myself, I tend to agree with most of their theses.
Some have posted that "you can not legislate morals" and then diverge from morals to mores. That which is socially acceptable can not be legislated, but basic morality, right vs wrong, can and must be legislated.