In a moment of touching naiveté they agreed to give it all up and accept the word of other nuclear powers (who got to keep their nukes) that they could rely on said others for protection.
One invaded them and the others had a sudden case of acute testicular fortitude failure.
Unsuprisingly, South Africa politely refused Obama's repeated, kind-hearted offers to let the USA take their weapons-grade uranium in exchange for (wait for it) a whopping $5 million worth of nuclear fuel.
Maintaining nuclear arsenal is quite expensive. The Ukrainian elites at that time thought they were just being extremely clever by getting 'guaranteed' security without paying for it. Their successors were dumb enough to threaten Russia's own security by inviting NATO to expand to the Ukraine.
They also produced lots of military goods for Russia. Thus it was no good idea trying to bring them into EU and as second step into NATO. They could have been a perfect neutral state serving both sides. But every side wanted their own oligarch.