The game-theoretical term is a "Nash equilibrium", which is the state that reality ends up in if every participant follows their own incentives (i.e. no participant can improve their individual outcome by altering their decisions). It is possible - even very common in many real-life games - to end up with a negative Nash equilibrium. The classic example is the Prisoner's Dilemma, where the globally-optimal solution is for neither player to defect, but each individual improves their own outcome by defecting, and so what actually happens is that both suspects confess.
It's also possible to achieve a positive Nash equilibrium out of morally-abhorrent individual choices. Mutually-assured destruction is a good example. The game is setup so that if either superpower launches their missiles, humanity ends. Therefore, both superpowers have an incentive to avoid nuclear war, and we're still here.
https://www.slatestarcodexabridged.com/Meditations-On-Moloch
It's possible that you could design a new system of government deliberately designed to counter some of these natural tendencies, to change the rules of the game to reward beneficial outcomes better than selfish ones. But I don't know you'd ever get such a thing in place when the people who can make that kind of change are the ones with the most to lose.