They didn't plan to join NATO. Ukraine had a single digit percentage interest in NATO before crimea.
Russia doesn't want Eastern European countries in NATO, because it makes it much harder to take them over.
NATO is a defensive alliance, and is no danger to Russia except for their imperialist goals. Best example of it is after Finland joined NATO Russia removed their troops from that border. That's right Russia now has less troops there than they had when they were imaging Ukraine.
And one last thing: even if it was true, since when Russia can decide for sovereign nation who they form alliances with? The excuse to invade looks exactly as the same bullshit Nazi Germany invented with Poland (both claiming to save German minorities and also that was actually planning to invade Germany). They are not even original.