I understand what you are saying. I agree that, in theory laws are supposed to protect equality and safety and be "just" and so on.
But I counter that this is a feel-good delusion. It is a story we tell ourselves because we like how it sounds. We want to believe that this is true. We want the law to be righteous, and fair, and serve us all equally. We really, really want this, as it makes us feel safe and helps us to keep a positive attitude about life and so on. So, I fully understand why you believe this. I really, truly do.
But it's still naive. That is why I said specifically that "Laws are not handed to us by God." The only way that law could ever live up to such an ideal is if it was forged by a perfect being. But, as you and I both know, all laws are forged by humans.
And not just any humans, politicians. The same narrative might apply to them: that they are our noble leaders, motivated by a higher calling to devote themselves to the service of the greater good. But we know this is false. It is plainly and obviously false. We see their corruption in the machinations of government every day. And it isn't even possible in theory that it should be otherwise. Consider:
In a democracy, politicians attain power by winning votes. Well, voters qualify as a "mob" and so have a mob-level of intelligence. They vote for whoever makes them the best promises, NOT for whoever is most qualified. Voters don't even have a way to assess who is more qualified. All they can see (and all they base their decision on) is who is the most charismatic, who promises the most desirable things, and (often) who is on "my team." That, my friend, is the best we can do, and it is a recipe for bad decisions.
Any honest politician will make realistic promises and often some unhappy predictions, and thus will be thoroughly defeated by the politicians who straight-up lie about what they can deliver, talk a slick talk, and play to the most petty elements of the voting populace. The honest ones are eliminated right at the gate. And if any honest ones somehow do attain office, they can't do anything by themselves. The system of checks-and-balances forces them to deal and compromise with all the liars and power-hungry narcissists who have also attained office. AND, as if dealing with the devil weren't bad enough, they face bribes and other temptations to fall to corruption themselves.
One cannot bear the ring of Mordor, and remain pure.
These, my friend, are the people who make our laws. It's not "once in a while" that something bad makes it into the set. It's a matter of course. It's merely "once in a while" that anything good comes out of this mess, and THAT is not driven by fidelity to lofty ideals of what the law should be, but by raw practical necessity (in order to BE rich and powerful, there must be a strong economy to support that wealth, so there must be at least some laws that keep the economy strong, and that requires at least some benefits to trickle down to the lowest echelons of our society).
And I still haven't mentioned the fact that the public often desires bad laws themselves. Sometimes, there is strong popular support for laws that are harmful and do not benefit the greater good, and inasmuch as the public has any voice at all, they push their politicians for this. Consider the very long stretch of history when the public insisted that homosexuals should not be allowed to marry, women should not be allowed to vote, blacks should not be allowed freedom, and so on. These things DID change over time, but we would be kidding ourselves if we believed that "the masses" were now a fully enlightened group that only demanded good and noble laws.
So, in sum, our body of laws is deeply flawed. It has a decent core of good laws but they were made only because they were necessary to keep the economy strong. The rest are just the end-result of rich-and-powerful people struggling against other rich-and-powerful people in this playing field, each trying to gain the most advantage over the other.
You can call it cynicism if you like, but, can you show me some sort of mechanism by which our law-making process is protected against corrupt politicians and unenlightened voters? Or some mechanism by which the body of voters is protected against benightedness, or the body of politicians is protected against bad apples? Because if there is such a mechanism, it's invisible.