It's no different than the crazy person I walk by every morning on the way to work. They have nothing to lose. I have everything. It's not worth it for me to get involved.
It's the same with the development of nuclear weapons. There is a near-zero probability that North Korea will engage in a first strike with nuclear weapons, but a very rational way of self-preservation.
The North Korean regime is reprehensible but their actions are rational, from a self-preservation perspective.
As the old saying goes, you're not crazy if everyone is actually out to get you.
Consider a world where they followed a similar path to countries like China and Vietnam. Their people would be a lot better off, they’d have a much stronger military, and they’d be able to be much more of an equal partner with their allies.