As others have pointed out, Ukraine was non-aligned. The Budapest Memorandum, signed in 1994 by the US, UK and Russia, provided that none of the signatories would threaten or use military force against Ukraine, Belarus and Kazakhstan, except in self-defence or otherwise in accordance with the Charter of the United Nations. France and China didn't sign the memorandum but later signed other, albeit weaker, agreements with the 3 nations. As a result of these guarantees, Ukraine, Belarus and Kazakhstan agreed to give up their nuclear weapons.
Given Russia's actions against Ukraine, why would any sensible-minded national leader believe a word that comes out of the Kremlin? Remember back in February how Putin and his cronies kept saying that the forces on Ukraine's borders were just conducting exercises and they had no intention of invading Ukraine?
Nobody wants nuclear war but, at the same time, we can't just stand by and let Putin get his way, particularly when it involves sacrificing Ukraine or other independent nations. Failure to confront Putin will simply encourage him to do the same again, and again, and again.