Nations and governments will always look to do things that put them at some advantage and make it easier to gain the resources they want or need. And they will always attempt to make their efforts seem humanitarian. Or at the least, they want to claim that they had no other option. They don't care if you see through it, and they are perfectly well aware that the main players see through it. They are doing it for the support of the masses, since that still matters if you want to run a country instead of being executed as a traitor or failure.
Putin cares not one whit about the pedigree of the people or who the land belonged to. He sees that NATO has grown and pushes up against his borders. Anything he wants or tries to get, NATO will always stand in his way. What to do? Grab up the last remaining bits that NATO has not collected. And Ukraine is rich in many resources and gives him more bargaining chips. And a much better position in the event of war in the future, whether initiated by NATO to rein him in, or initiated by Russia to grab more land.
NATO sees Ukraine as the last piece that they would need to effectively box Russia in. And having them on the NATO side also means that those resources (oil, natural gas, arable land) are not under Russia's control. A weaker Putin is useful to the West. It can help to weaken China a bit, and they want that as well. It is no accident that there has been a fervent push to get more countries to join NATO as a result of the Russian invasion, and it seems to have paid off handsomely, with Finland (an old enemy of Russia) agreeing to join. I think that alone might be worth the money they are throwing (and will keep throwing) at Ukraine.
Neither side sees Ukraine from any other angle, IMO. It is an important piece of land, and control of it (or influence over it) makes one side stronger at the expense of the other. The USA does not expect that Ukraine will ever fully pay them back for all of the weapons and money. What the USA is buying is a stronger position in Europe and a weakened Putin/Russia. I think Zelenskyy is smart enough to understand that he's a pawn in a much larger game, and that if he plays his cards right he might walk out of this with his neck intact and the 'undying friendship' of powerful and wealthy nations.
Politics has never been anything different. When we study the actions of powerful nations over the course of history, we always see the same thing- they do anything and everything they can to get what they want, while trying to put forth a good face to the world. What do they care that we will finally learn what they did, a hundred years later? They had a lot of power and they got to use it, and even to be cheered as they did so.