I think you vastly underestimate the amount of resources that would be needed to rebuild NK after a military toppling of the Kim regime, and of the level of humanitarian disaster that would be unleashed by such an act.
Most importantly, you have not outlined how China stands to benefit from a regime change, compared to maintaining status quo. Kim is only a threat in western media propaganda, there is no realistic scenario where NK can pose a threat to China.
On the other hand, a unified Korea under the influence of the USA would be a devastating blow against Chinese security.
The Korean peninsula is a core interest to China, cost is not very relevant here. How much did it cost China to intervene in the Korean War? It'll cost China far less now, it can potentially even make a buck exporting the excess industrial capacity and expertise, though I'll admit that at least directly it'll probably require some soft loans that'll end up lose money. With that said, those industries are money pits right now, they're already losing money and requiring government handouts, so why not put them to use advancing China's strategic interests?
AndrewS wrote a pretty nice summary of how the post-war situation can benefit China, so I won't repeat the points here.
A unified Korea would be under the influence of China. Who do you think has the will and capability to help SK rebuild? An increasingly isolationist U.S. who's just begun to recover from almost a decade long financial crisis and has a hollowed out industrial sector, or China who sees stability and friendliness on the Korean peninsula as a core interest, has $3 trillion reserves, and the greatest industrial capacity that the world has ever seen?