The ghost towns are produced by a unique Chinese financing vehicle known as the local government financing vehicle (LGFV).
The LGFV is a company created by the local government, which is in charge of collecting local farmland, moving the farmers off the land, then rezoning it for urban use. This land is bundled up into a bond, which is sold to China's most powerful bank, China Development Bank (CDB).
CDB is wholly state-owned by the Chinese Communist Party and its chairman is Chen Yuan. After buying the bond, it provides financing money to the LGFV. Then, the LGFV invites developers to submit development plans, and develop the land.
Then the new homes are sold to the new urban residents.
China has more than 10K LGFVs. Not all of them are successful, and some lose money. The ones which fail are ghost towns.
The LGFV is the urban development financing model used throughout all of China.