Morality matters very little here. Was it moral for the West to intervene after 1991 to loot the post-soviet states leading to the death of 7 million people? No. Was it done anyways? Yes. This is the context in which you operate. If you decide to operate morally when confronted with amoral actors all you will do is cause the suffering of millions of your own citizens.
This is imperialist justification of literally invading and annexing parts of another country that they consider a renegade vassal state. It’s not defensive in the least. Come on, this is super weak justification.
Russia hasn't invaded Ukraine because they consider it to be a vassal state, Russia only invaded Ukraine after the Euromaidan movement suceeded and pursued integration into the EU and NATO. What you are saying may well be the propaganda Putin and his proto-fascist cabal give, but it is not the actual reason, or they would have acted much before and wouldn't have stopped in the Donbass.
And again, who Ukraine wants to align with is Ukraine's choice. Just like the US has no business demanding Cuba cannot align with the Soviet Union or Venezuela (threatening or especially invading them in response being morally reprehensible), Ukraine must be free and sovereign and in command of its own future.
Who Ukraine wants to align with is Ukraine's choice as a matter of fact, and as a matter of fact where Russia puts its troops is also it's choice.
You can't compare Ukraine with Cuba or Venezuela. This is as if, after Mexico had joined the Soviet Union, Canada was about to do so as well. It's a core Russian national interest. No matter how Russia is structured, it simply won't ever allow NATO to share a border with it. The West invaded Russia on average every 40 years since the start of the 19th century, and just three decades ago American intervention in Russia led to the death of millions. There is no comparison, from the Russian perspective this is a matter of survival, they perceive that if NATO is able to surround Russia they will use this tactical advantage to ruin the country.
Should Ukraine in theory be able to join NATO? Morally, you may very well feel that way. But in the world of real politics, you cannot always chose the moral action unless you are a Hegemon. Otherwise, millions of people will suffer. It's just how it is. And unlike you were claiming, it has nothing to do with some ideals of national identity or manifest destiny, it's simply a cold geopolitical calculation that concludes that Ukraine in NATO is unacceptable and will probably in the long run lead to mass misery.
And compared to NATO, Russia absolutely is the underdog.
But sure, good on you for missing the point. It's very principled to just ignore reality. It's not like Russia got absolutely fucked and millions of people died when they tried to open up to Western Europe the last time. What matters really is that we can pretend that Russia is the bad guy and we aren't when they occupy a region whose majority want to secede anyways from another authoritarian oligarchy to prevent a military alliance who only ever operated offensively and was involved in the deaths of millions of people to settle on their borders, right after the puppetmasters of that region trafficked the Russian elections to extract hundreds of billions from its economy at the cost of millions of deaths.
But surely what matters here in this incredibly complicated situation is to follow the Moral (tm) course of action even if it drastically increases the risk of war and suffering.
Come on, there is no moral equivalence to invading and annexing a country. This is not excusable.