In a world with only good people, would you still need laws?
Okay, sure, we need to define some things. By good I don't mean some impossible god and/or trolley driver who can solve any moral dilemma, just a regular person who, faced with a moral decision, would always do what the law would have them do anyway. It's illegal to steal, but who cares? They know it's wrong to steal so they won't do it.
Obviously, there can be unjust laws, in which case breaking the law might be morally good, or at least not bad. There can also be moral decisions that the law doesn't cover (like whether to donate to charity) and laws for things that aren't moral decisions (like standard license plate formats or whatever). Those might be interesting, but let's ignore them for the sake of this argument.
So if we consider just the laws that are intended to enforce generally-agreed moral behaviour, and take a society full of people so moral that none of them would ever act immorally, do those laws still need to exist?
You might think the answer is no, but I'd like to make an argument for yes, based on the idea that, much like making a decision between ice cream flavours is effort, making moral decisions is also effort. I'll have a chocolate sorbet, waffle cone, and paid for, not stolen, thanks.
It probably doesn't feel like you're deciding not to steal whenever you pay for something, but I think that's exactly because we live in a society with laws against stealing. When there's a large enough cost for an action, it just disappears from your candidate set of choices, the same way you (hopefully) don't think "maybe they have different ice cream flavours at the other shops, I should check them too".
In other words, though the main goal of laws that enforce moral behaviour is, in fact, to enforce moral behaviour, they also have the side-effect of making it easier to engage in moral behaviour, because you can rule out certain immoral behaviour as infeasible or unreasonably costly without having to actually think it through. I think of this as decreasing your moral load: the effort it takes to make moral decisions.
In a world with imperfect moral agents, this is particularly important, because maybe a high enough moral load would cause people to stop making good moral decisions. Even in moral utopia, though, nothing says the citizens never want to act badly, just that they don't. Perhaps the moral load costs them in other ways: making their other decisions worse, using up their time and energy, or even just making them unhappy, which is pretty rude to do to perfectly moral agents.
So perhaps the world with only good people would get together and decide to establish a totally useless legal system that only exists as a peculiar kind of economic specialisation: a centralised conscience that allows everyone else to get on with other things.