Since China does not control North Korea, having an uncontrolled nuclear-armed neighbor is tantamount to a declaration of independence. Keeping North Korea non-nuclear keeps North Korea in a position of subservience. It must rely on China to broker relations with the rest of the world. If North Korea successfully becomes a nuclear power — meaning that it can reliably produce weapons and weapons systems — then the United States, counter-intuitively, could become the broker of North Korea’s relations with the outside world.
This is not inconceivable.
China wants to protect North Korea so that the United States cannot easily or readily help re-unify the two Koreas, which would give the United States a much larger geopolitical footprint in the China’s sphere of influence. The seven-member politburo in China really does consider this a possibility, even though it sounds bizarre: North Korea rejected direct negotiations with the U.S. that would have started at the ministerial level. Kim Jong Un believes he ought to deal with President Obama directly, as Ambassador Rodman noted.