Ukraine did not sign up to any treaties. It also wasn't sure about this -- unlike Georgia for instance
Also, due to centuries of Moscow steamrolling over the people of the Ukraine, they have not had a chance to create a sense of nationhood - heck, many just speak Russian
The next challenge to NATO will be this: "Should we risk nuclear war for a little country like Latvia?" If the answer is "no," then NATO collapses. This is the end-goal of Russian military strategy. Ukraine is just the second stage, after Georgia.