Ukraine was explicitly rejected last time they tried to join NATO. Although they will get in now, and so will Finland and Sweden, so it was obviously counterproductive!
But Russia doesn't even care about that. They're just ideologically opposed to Ukraine existing and want its industrial resources back. They don't even say it themselves, you just make excuses for them.
As it stands, Mexico doesn't even bother with significant defense spending because they know that the US isn't all that interested in invading and no one else is going to try to invade a country which shares a land border with the US.
On the other hand, the various Russian neighbors who have joined or have expressed interest in joining NATO have done the same calculus and determined that Russia is cannot be relied on to not threaten their borders.