I think you’re falling for for Russian propaganda here. While there was a push from the US government for Ukraine to join NATO back in 2008, it was rebuffed by the major European members.[1]
Even in March 2014, a month after Russia began taking over Crimera, Ukraine had no intention of joining NATO.[2] In fact, their constitution prohibited it until 2019[3]. A change made after 5 years of war in Donbas with Russian support, as well as the annexation of Crimera.
What did happen in 2014 was the Maidan revolution[4] as well the signing of the EU-Ukraine association agreement.[5]
I’d argue, what Putin if afraid of is not NATO at his borders (though it plays well with some of his audience), but a stable, democratic, and economically prosperous Ukraine that might even be an EU member. And to be clear, Ukraine today (even before the invasion) is far away from all 4. But it’d be a formidable threat to Putin’s autocratic and kleptocratic government.
1: https://www.nytimes.com/2008/04/03/world/europe/03nato.html 2: http://en.interfax.com.ua/news/general/198372.html 3: https://eu-ua.org/novyny/zakon-pro-zminy-do-konstytuciyi-shc... 4: https://en.m.wikipedia.org/wiki/Revolution_of_Dignity 5: https://en.m.wikipedia.org/wiki/European_Union%E2%80%93Ukrai...