Once you have nukes, you think, you'll have a shred of leverage over the US since you'll have the capability to nuke Seoul. With that leverage, you can ensure that your glorious people's republic will continue to prosper without another devastating war. Who cares if you throw the economy under the bus until you're nuclear-armed - that's just the price you have to pay for security.
I personally don't think that the DPRK has any real intention of starting a war - they know that there's about five minutes between hostilities being declared and Pyongyang turning into a radioactive parking lot.