That is a misunderstanding. The stated and actual purposes of the UN are different. The actual purpose was to give great powers a place to negotiate with each other, so that we wouldn't get a third world war.
That is why the 5 most powerful countries were permanently put on the security council with complete veto powers.
There was a brief period, from the fall of the Soviet Union to Bush's invasion of Iraq, where "rules-based international order" was not a joke, and in fact was taken pretty seriously by quite a lot of people.
Democracy, free trade, free speech and freedom of religion had "won" over the soviet union. International treaties were reducing stockpiles of nuclear and chemical weapons. The WTO had just started resolving trade disputes through negotiation rather than trade wars. International peacekeeping forces were preventing ethnic cleansing in Bosnia and Kosovo, even though there wasn't anything like oil motivating the peacekeeping forces. Planners of the genocides in Yugoslavia and Rwanda were being prosecuted by an international war crimes tribunal.
Then-UK-Prime-Minister Tony Blair believed in this stuff pretty earnestly - in fact he wanted to get a UN resolution authorising the Iraq invasion so badly he was happy to submit fabricated WMD evidence to get it.
Of course, even at the height of the "rules-based international order" there were always some stark inconsistencies - especially in the middle east, for example.
You imagine wrong. It was a point that I first remember seeing from https://en.wikipedia.org/wiki/Gwynne_Dyer. Who is not from the US, but is an expert on the subject.
It was in his documentary series War, but I don't remember which episode.
That is why the 5 most powerful countries were permanently put on the security council with complete veto powers.