Yeah I never understood this line of logic. NATO expansion is a voluntary matter. A country applies to join NATO.
And of course Russia for the last 30 years has kept NATO relevant as Russia tried to interfere with its neighbors, often violently.
As far as Ukraine is concerned it is bizarre as Ukraine wasn't about to join NATO before it was invaded by Russia. And Estonia, Latvia, Norway, Lithuania, and Poland were already on the border with Russia, so much of the security apologia for the invasion doesn't hold up under even mild scrutiny.