Well this goes into the debate of "is morality absolute or relative" which gets religious fast and there's more books on the subject than we have time to read.
The question of "are laws there to enforce morality, or enforce public order?" is the key one. And, I think, very easily settled by looking at the laws we choose to implement. Almost none of them enforce moral behaviour (e.g. you must give 10% of your income to charity), they're all about enforcing how we interact and how we're ruled.