We don’t know all the reasons why Russia invaded Ukraine, but we can guess at some of them. Fear of NATO is certainly part of the picture, but only part. The largest element is greed.
Money and power drive our wars, and this one is no different. If it was just about stopping Ukraine from joining NATO, Russia would have used a different strategy. But, since Putin has bigger ambitions and perceives the West to be weak, he chose the more traditional path to empire.
Unfortunately, it looks like this is exactly what some in the West wanted him to do.