North Korea is a stalwart ally.
North Korea is a problem for the USA that China can turn up or turn down.
North Korea is a trade partner which per force gives China sweetheart deals.
If North Korea did not exist as a separate entity there would be one united Korea which would be a US ally and a more significant rival to China militarily and economically.
If North Korea were free it would set a dangerous example to Chinese people who want freedom.
If the United States succeeded in North Korea she might be tempted to do likewise in China.