This answer seems to be bait forBoy, the "yeah-but" gang just hates this question. Think it through, and for Pete's sake stop takingI added a bit at the rule of lawend about how to see for granted, like as if people would keep following the rule of law if it was gone. Real world experience says otherwise, not that this stops theorists like Karl Marx or Ayn Rand from designing cheap systems that would only work if everyone bought into them. Forget it, people are complicatedyourself.
The rule of lawrule of law exists to replace any of these: { violence, extortion, corruption etc. } as ways to resolve conflicts.
In other words, the law is a system for resolving conflicts.
If you don't have a conflict, then you don't need law.
As a general rule. Of course there are many cases where the government or other parties help people, and there are laws connected with that. But even then, the laws are about conflict - the laws on who can get a Medal of Honor are to keep a president from giving them bric-a-brac to undeserving people. The laws concerning public charities are primarily about the tax deduction allowed for charitable donations and preventing people from abusing that.
And I'll grant there are innocent exceptions; if a government bans symbols of fascism, a law would be needed to exempt history museums, and everyone would agree there, sure.
Wherever there is a government giveaway or charitable program, and there are many - there are people trying to commit fraud against that program. That is where laws meet "doing good", except the law only touches it where conflict exists or might exist. (which is why you need to fill out forms and swear to stuff to get government assistance).
See also "Good Samaritan" laws which protect people who earnestly did the right thing by trying to save someone, only to be selfishly attacked by the person they saved. Another case where humans inject conflict into a good thing.
"I don't understand how (this one law I'm thinking of here) can be about resolving conflict. I don't see any conflict to this law."
Well, sometimes you need to put your thinking cap on and think about all the stakeholders and their likely views. Take a sheet of paper, draw a line down the middle. Proponents to left, opponents to right. This is where most people choke spectacularly, because of either magical thinking which ignores externalities and perverse incentives, or political polarism that has trained them to 100% ignore their opponents, and thus are unable to relate to any view but their own.
Free college and daycare to single moms. Pros: obvious, reduces poverty, stokes economy, helps women avoid abortion. Cons: the fiscal hawks won't like the expense. Encourages childbirth (bad for planet). Discourages marriage (bad for morals).
For any law that is passed, you can do that. Really. Try it, earnestly, without manipulation.
Granted you'll have the rare exception: "Previous law banned private collection of rainwater, but did not consider effects on flood control dam. Proposed law: Exempt flood control dam from other law." Pros: many. Cons: None.
But they will be rare. If you are finding many laws without "cons", you're cheating lol.