There was zero chance Ukraine would have ever been admitted to NATO. Everybody understood that, including Putin and his generals. And while NATO and the U.S. maintained the official position (perhaps better characterized as a non-position) that any country, including Ukraine, remained free to apply to NATO, member states like Germany would have vetoed and almost certainly privately gave such assurances to Putin. Moreover, the last decade of shenanigans from Turkey and then Hungary have soured even the U.S.'s appetite for future NATO admissions of any country outside Western and Central Europe.
Ukraine missed its window for NATO membership by about 20 years. Today the U.S. wouldn't even seriously imply Ukraine had a chance at membership. Russian apologists would point out that Ukraine already entered quasi-formal "dialogue", but fail to mention that such such dialogue has been frozen for nearly 20 years. The status quo (which has no actual substance, anyhow) is for all intents and purposes permanently frozen. One might reasonably criticize NATO and the U.S. for leaving things as they are--to fester. The counter argument is that by making a formal concession it would only embolden Russia, which would never change their tune even if NATO formally renounced the possibility of Ukraine joining. Perhaps more importantly, it would be a huge loss for Ukrainian reformists. (There was a similar motivation behind the EU's long refusal to state the obvious regarding Turkey's membership in the EU.)
Beyond Putin's general revanchist sentiments, what he and other Russian leaders really worry about is de facto Ukrainian-EU economic integration, not NATO. There's little chance (but perhaps non-zero, and greater than Turkey's) Ukraine could ever join the EU anytime soon. But there's an infinite number of intermediate relationships, all of which disfavor Russia--at least from the Russian perspective.