Nuclear weapons from the USSR and then under the operational control of Russia were stationed on its territory. A lot of them.
They could probably not afford to keep them and to maintain them, they didn't have full control over them at the time, and my understanding is that most of them were ICBMs, so more useful against the US than against neighbouring countries.
Lastly, it's also most probable that no-one wanted Ukraine to have nukes so everyone 'nudged' them into the 'right' direction at a time when they were rock-bottom. Obviously promises are worthless but they can help sweeten things a bit.
Now, countries that have nuclear weapons now know why they do and aren't going to give them up unilaterally in any case. It is not easy to develop nuclear weapons, either.
So, overall the topic is a red herring.