And yet you have to wonder, on an alternative timeline, what if Ukraine says it won't join NATO and stays under Russia's sphere of influence? It would suck for national pride but maybe under that alternative timeline they won't get invaded now and possibly wouldn't even lose Crimea earlier?
Practically speaking, perhaps you should avoid poking the aggressive neighbor next door, especially when you can't have definitive assurance from the police station three blocks over?
There was little support for joining NATO before Crimea was annexed. Ukraine wanted to join NATO precisely because it realized that it will be devoured piece by piece by its imperialist neighbor unless it does.
It's not just Putin; Russian leaders through most of the 20thC have feared encroachment on their western borders, and have launched invasions and installed puppet regimes to create a buffer. The fact that Ukraine has clearly expressed its desire to join NATO, and NATO's refusal to reject that possibility, means that Russia perceives a threat that their greatest enemy will suddenly appear right on their border.
Georgia also wanted to join NATO; so they got invaded.
The West has played this hand very badly. Instead of declaring that under no circumstances would they send troops to Ukraine, they should have kept silent, or possibly sent a division of ground troops, to be dispersed around the country. They should also have leaned hard on Ukraine to make Donetsk and Luhansk officially autonomous regions. The Donbas would then become Russia's buffer zone, making them feel a bit less paranoid about NATO encroachment.
FWIW, I think NATO should have dismantled itself following the collapse of the Soviet Union. The modern NATO is a global organisation, not restricted to the North Atlantic. It's no longer a mutual defence pact for countries at risk of Russian attack; its main purpose now is simply to intimidate Russia.