In a properly functioning government, the different branches provide checks on each others' powers, with the ultimate backstop being the power of the people via voting.
Long-term, I think the problem is that no system of rules will be, or can be, complete enough to maintain a stable society - regardless of the philosophy the system is based on. And that's assuming the rules will be enforced and followed 100%. Rules written today won't be complete enough for tomorrow.
Obviously we can create a system that can adapt by adding new rules, but the ever-growing stack of rules creates its own set of problems, as the new rules interact with the old and create internal conflicts. Over time the system loses consistency and coherence.
I think something external to the rules is necessary, something that motivates a common cause... but I don't know what that would be.
I know. Historically I think the only examples of societal guiding principles that have really functioned for more than a decade have been religions.
But of course, religions come with all sorts of nasty baggage that hobbles societal development, frequently including anti-science behavior. Religion isn't the answer, it causes too many other problems.