I don't think you're disagreeing with me, you're just comparing to a more recent status quo.
Nuclear non-proliferation was based on the idea that small countries didn't need their own nuclear weapons, because they could ally with a superpower / bloc with nuclear weapons, and piggy-back on those superpowers not wanting to go to war, to avoid nuclear confrontation.
It is true that some countries, like Israel and North Korea, never bought that idea, and went ahead and got their own nukes.
That those countries who didn't buy into non-proliferation have fared better in the last couple decades than the ones on your list who have been attacked with little repercussion, is exactly the point.
Ukraine was willing to give up its nukes decades ago, now it's clear they shouldn't have. Iran was willing to enter into a non-proliferation agreement a decade ago, now it's clear they shouldn't.
But this is a much worse equilibrium than if we could have actually made non-proliferation work. Now every small country should clearly be trying to build nuclear weapons, if they can. And I think that's bad.