The country’s economy is broken.
I don't think China's economy is broken, I think it's working, more or less, as intended. We have to remember, China is not a free market economy, they are a state directed market economy. They are a hybrid of a centrally planned economy and a market economy. I know many people think these two things are mutually exclusive, but apparently you can have elements of both in the same economy.
I don't know why China over-built in housing by so much. Maybe they anticipated the population would grow more than it has, or maybe they never intended for these properties to be occupied. Maybe they built these properties to spur some growth and create jobs, and didn't really care if they were ever occupied or not.
I'm sure these projects were funded by loans from China's state banking system. They lend the money to builders, the builders use the money to build a bunch of buildings, which creates jobs and economic activity, then the builders can't sell the buildings, so they can't repay the loans, so the state run bank has to charge off the loans, but maybe that was planned from the beginning. That would mean the Chinese state banks would have a lot of write-offs, and that's true, but they're not private, for-profit banks. They're part of the state, and the state prints its own money. The Chinese government can seemingly create an infinite amount of money, so they can seemingly lose an infinite amount of money.
There's no question this is incredibly wasteful, and bad for the environment, but if your goal is economic growth above all else, this strategy does seem to work.