The annexation of Crimea by Russia came after Ukraine sought an association agreement with the European Union, not with NATO at that particular point, leading to Vladimir Putin citing security concerns about the expansion of NATO as a reason to invade.
The decision by George W. Bush to expand NATO by adding Ukraine or Georgia would not enhance the security of the US because it would threaten the relationship between US and Russia due to Putin's nationalism, which is the source of his popularity in Russia.
The US has long recognized that Putin is a thug, and that Russia's security would be threatened if Ukraine were allowed to join NATO. The US has, however, refused to consider this same security externality when it comes to Russia's aggressions towards Ukraine.
The Ukraine conflict could have been prevented by engaging in diplomacy, and the deal that could end the war is for Ukraine to remain a neutral state. The question is, what is Putin willing to do in terms of evading other countries?
Despite external observers believing that Putin would win the war in Ukraine swiftly, the conflict has instead been prolonged with limited objectives. The uncertainty of the outcome can lead to individuals engaging in war, even if they are rational.
Many experts predicted the war in Ukraine as Russia had communicated since at least 2008 that NATO expanding to Ukraine was a red line. Bill Burns, CIA director, warned Condoleezza Rice in 2008 that expanding NATO to Ukraine was a red line for the entire Russian elite.