It's because in 2022 it was banned based on the UN Resolution of 2021.
What's the heck are you talking about? In 2022, Russia was banned because of doping. Since when UN does issue resolutions about doping? Which one of its 15 members care about doping in sports and can put a resolution to vote in front of the 14 others? That's none of their business at all. Please find me which 2021 UN resolution mentions doping, preferably with its number. 2021 UN resolutions go from nr 2561 to 2617. They are all about peace and political unrest. There is nothing even remotely relevant to sports and/or doping, which, again, is not surprising. Moreover, Russia went into Crimea one day before the end of Sochi Olys and Sotchi is in Russia, hence making it impossible to ban the nation at its own O.G, despite they violated the Olympic truce. 4 years later, their Olympic committee was suspended for doping but their athletes were allowed to go under the condition they had never tested positive and would undergo specific tests.
In 2008 Russia could not be banned by the IOC as the fights in Georgia started in August, i.e., not during the Olympic truce.
Anyway when IOC bans a country, it's only a recommendation, not a legal obligation as they have no legal power. Some national federations do not follow these recommendations. It happened after 2022, some sports federations did not ban Russians and the IOC could not oppose the non-ban, especially when no Olympics were yet involved.
The only valid parallel with the US to me is the invasion of Afghanistan by Russia in 1979 and the some 50 nations that boycotted Moscow summer OG 6 months later. Russia was still USSR and invaded Afghanistan ("for its own good", just like the US do in Iran right now) in December, out of Olympic truce.
I agree that the US should be banned from next Olympics/forbidden to organise them but for the breach of Oly truce, not in the name of something that does not exist. The IOC can ban countries for only 2 reasons: doping and the breach of Oly truce that ensures safety of travel to all athletes in the world. IOC is indeed a political organisation but Olys have been political since their very beginning. Ask the Greeks and the Romans: Bread and Games for the people. Or how to divert the population as a whole from social troubles and politics.
I don't know if you are a troll or only very badly documented but what you said here has no ground nor sense.