> simplifying: "laws and moral codes exist to restrict 'human nature'"
I strongly disagree with that. Laws (and moral codes) exist to codify the general, agreed-upon human nature. They therefore "restrict," as you say, a subset of people whose internal moral compass is broken.
To pick the most extreme example: most people don't need a law, or even a moral code, to not kill other people. We all (for some large and growing, but not 100%) agreed that killing is wrong, and most of us do not need the threat of a murder trial to talk us out of killing someone who cuts in front of us at the fast food line. To be clear, not 100% of us, but more than 50%, and I hope in many places, much more than 50% of us.
For other, less extreme crimes, the percent of people in consensus might be lower. But even for something like speeding on the highway I think human nature is, on average, a limiting factor more than laws or moral codes, rather than being an uncontrolled source of chaos reined in by law.
People (on average) drive maybe 60-80 mph on the highway (depending on the highway -- looking at you, Montana). If there were no speed limit at all, that wouldn't jump that much: the average speed on the autobahn is apparently 125kph, or 78mph.
Everyone's human nature is, on average, reasonably aligned, and laws tend to reflect that average.