Ukraine got under control of a West-oriented government and many Ukrainians supported that. Military and economic ties grew. This telegraphed that Ukraine was on the path to be lost from the Russian sphere of influence (satellite states). Also it was an uncomfortable/dangerous for the Putin regime because it signaled to Belorussians and Russians that a different, west-oriented government system is possible.
Putin's popularity was falling before the war; nothing quite like war and war propaganda to neutralize discontent of powerful groups in Russia with the government; also works on the gullible part of population.
Lots of gas deposits and other natural resources in eastern Ukraine.
Belief in a quick "fait-accompli" win, resulting in expansion of Russian-controlled territory and gains in domestic popularity. Increase of power on the geopolitical scene, more power in relation to Europe.
Biden looked like a weak president who would not do much.
West did almost nothing in reaction to annexation of Crimea.
West did not want concede anything big to Putin during the talks. Probably rightly so.
Of course there was, Ukraine becoming a NATO member. Just read Putin's address [1] after the invasion started, it is spelled out in no uncertain terms. You may disagree whether this warrants are war but this does not change the fact that there is a reason and Russia consistently said so for decades.
[1] https://www.bloomberg.com/news/articles/2022-02-24/full-tran...
He has spelled it out before--he believes that Ukrainians are really Russians, and therefore Ukraine should not exist as a separate country because why divide a nation in two.
What's the end game? What's the goals of the war? How does an invasion, that has to end at some point, stop Ukraine from joining NATO?
Even if Ukraine looses, Russia has no ability to force them to do anything. Russia wins - and then what?
You are right, nothing will guarantee that they never become a NATO member, but for some time is a plausible goal. Even just being in an active conflict prevents a NATO membership unless the rules are changed which is what Crimea and eastern Ukraine achieved since 2014.
Saying that this particular instance of territorial expansion has a self-defense motivation is, I think, implausible given the history.
Realistically, Ukraine was left with the choice of slowly losing territory to Russia, or joining NATO.
When I first researched this after the invasion started, I arrived at Russia reacting but I am open to being proven wrong.
Ukraine was absolutely not becoming a NATO member. Before Februrary, nobody considered that realistic possibility for decades, at least.
Ironically, thanks to Putin's war, Ukrainian NATO membership is starting to look more plausible (and Swedish/Finnish membership is virtually assured).
I believe Swedish/Finnish membership has been officially accepted by NATO. All that remains is collecting the official ratifications from the rest of NATO. (Currently, 8 of the 30 member states have yet to ratify it.)
And, given the importance of Russian oil and gas in the post-covid recovery period, the predictable reduction in nuclear capacity in France and Germany, the plausible lack of support from EU population and German industry for a cold winter, Putin's aging, etc... It might just be that the timing felt "as good as it will ever be".
Also, being on the "initiative" side gives your more positive outcomes. Best case was a flash invasion of Kiyv with public support. Next best case, a flash invasion without public support. That didn't pan out, but their next option is not terrible : grab as much territory as possible in Spring and Summer, then... Wait it out. General Winter will give Russia a pretty nice seat at the négociation table when EU citizens finally bail out.
Now, it's possible that we europeans stand the cold (or maybe, FSM willing, that winter is _not_ cold), that US weapons work, and that Putin contends with "I keep Crimea and some water, you join NATO, Dombass stays neutral." Sadly, that looks like the "best" plausible outcome to me - but who knows...
Whether that will count as a good outcome really depends on what follows: chaos and civil war could be terrible; a short caretaker government followed by the election of Alexei Navalny might be the best possible result.
Wars are more often fought because people have differences that are actually legitimate, meaning reasonable people can at least see the point of view of each side.
Obviously all war is terrible, but at least usually you can see a reason for the war.
This one though? There was absolutely no reason for it.
NATO was not actually expanding. Russia has no chance of occupying Ukraine and keeping it. What are Russia's goals? No one can even say, not even Russia.