Never ever underestimate the power of being self sufficient military wise. You can pretty much do anything you want and get away if you are a nuclear power. And its not like North Korea is going to remain poor forever.
Look at UAE and Singapore, it takes little time to change the economic situation. A little years here and there, with China's and India's emergence on the world scene things can change pretty rapidly. To cut US's influence in Asia, North Korea is a indispensable asset.
Allies are not permanent and US's help to Japan and South Korea is not infinite. Geopolitical situations will always change and have always changed throughout history.
Given this situation, North Korea can be a big player in the future, now imagine having the military might in this situation. It can force unification of the Korean peninsula on its terms in the future.