Security and military come before economic gain. If they don't join NATO, they might have to fight against NATO, and China doesn't provide any protection to its allies against US-conspired coups and following invasions on the pretext of humanitarian intervention.
The US forces and co-ops are everywhere. What most countries need first is security that they wouldn't get bombed or ousted by the US. Economy is a next matter. People often think "security with the US and economy with China but security is always more important" because if you don't have security, you don't have economy either. There is no point getting Chinese investment and then get "regime-changed" or bombed by the US. Works the same for China too. There is no point investing all the money in other countries only to be destroyed/sabotaged by the US military intervention and the new US puppet cancels all contracts with China and debts to China. That's why China's economy-driven diplomacy has limits.
But that is exactly what China is trying to do.
It started with Chairman Mao. The idea is to overthrow the old order.
What is described as security and military comes before the economy, that clearly is the old order. That goes all the way back to the age of Imperialism.
China is going to defeat that by doing it different.
The catchphrase the CCP uses is what the level of development a country is at.
China is all about development, and what level of development an independent country would be at. China is willing to do business.
America is all about the old order, where someone has to be number #1 and everyone else must have their place in their heirachy.
The CCP is trying to defeat the old order by doing better.
China is still growing at 5% or more, dragging the entire region with it.
What is America doing? Not much.