Ukraine gave up the nukes stationed on their soil because we told them to. They were incapable of maintaining them, and the nukes were useless for defense anyway as they did not possess the launch codes.
As Ukraine was the world’s most corrupt country, we feared they would sell off the nuclear material to bad actors to make a “dirty bomb” (a real possibility). For the same reason, we took over their bioweapons labs and cleaned them out, and paid their scientists nice salaries to keep them from defecting to enemy states or terrorist organizations. (Note: Contrary to what some beleve, the “biolabs” operating in Ukraine were not bioweapons labs, but standard infectious disease surveillance labs, same as we operate in many countries around the world.)
Lastly, in reply to your “If you want to keep Ukraine from getting nukes, then give them the support they need.” — what they need are weapon systems we have run out of and more boots on the ground. You want to recruit your children and grandchildren to put on their boots?
That is a foolish argument. Anyone with physical custody of such a device could re-program the detonator to have a different code.
With physical possession they could have just replaced the launch module. Remember that there were many Ukrainian scientists and engineers in the Soviet nuclear program.