What was Ukraine supposed to do? They were an independent country where a larger, more powerful neighbor was fomenting a civil war within its boundaries. By the way, its predecessor, the Soviet Union, destabilized governments in a similar way across the world during the Cold War. The US and Great Britain had made it clear that they would not honor the implied commitments of the 1994 memorandum. Therefore, like almost every other Eastern European nation, it seized upon NATO and EU membership as its only possible security guarantee.And if memory serves, the Ukrainians have been fighting internally for quite some time with the eastern part of the country pro-Russia and the central and western parts pro-West/NATO. Russia is not going to have any tolerance of Ukraine being part of NATO and after the last power shift in Ukraine that was what was being pushed for, NATO membership. Not excusing Russia one bit in all of this, they are definitely the aggressor, but the last group that got a hold of power in Ukraine was definitely poking the bear, and the bear threw a punch because the US an EU had feckless leadership, and the bear knew it. The Ukrainian leadership made a bad choice on that front. People are being myopic a bit, IMHO, as they don't look at who they are dealing with in Putin, he's an old Soviet Union KGB guy and that's the prism he views the world from. Ukraine in NATO is a 100% red line in the sand for him. Putin miscalculated though thinking the Ukraine was going to be a pushover, cost him 800,000 men. It's also put him in a bind at home on a number of fronts. I personally think Putin wants out of this mess but it seems like the Ukrainians keep asking for more "aid" to continue the fight. Don't think they were anticipating the response they got from the US this last go around. Hopefully this thing comes to an end soon.
Seeking such security guarantees hardly excuses Putin's brutal invasion, an invasion, by the way, that has added nearly a thousand miles of NATO border to Russia in hiking distance of St. Petersburg (Finland) and turned the Baltic into a NATO lake (Sweden and Finland). Strategic brilliance on Putin's part.
Of course Ukraine is continuing to fight - just as I pray we would were the PRC to occupy 20% of our country on the West Coast. Every Russian they kill puts additional pressure on Putin to make concessions in any negotiation - at least it did until Trump seems to suddenly support Russia and its aims.
No nation will want to provide a bilateral agreement to defend Ukraine against renewed aggression. The simplest way to provide them with a collective security arrangement is simply gran them NATO membership.