The data is encrypted and users in China have to accept the terms that explicitly state that Apple must comply with government requests for access to their cloud servers in China. It wasn't a situation where they changed course or pulled the wool over someone. You're being deliberately disingenuous and misleading.
Apple complied while still retaining as much security as possible. They assert that the data is still encrypted, and they hold the keys:
https://www.nytimes.com/2017/07/12/business/apple-china-data...
Apple had, as I see it, two choices: disable current customers and refuse to sell any more devices, or comply with the law.
So, yes, Apple could have walked away from their customers, but how would that have helped anyone? Their phones are still more secure from non-state actors than nearly anyone else's, and Chinese citizens, for better or worse, have to live with the dictatorship's rules.
(And to preempt the inevitable comparison: https://www.theguardian.com/technology/2015/sep/21/google-is...)
So "They literally made a deal to spy on Chinese citizens as soon as that made them profit" is only true if you assume Apple is lying about the encryption and lying about their reasons for opening the new data center.
It's also possible the OP is talking about some other Apple cooperation with China, but that seems to be the one most people throw at them.
Additionally, Google is absolutely bad, but that is just whataboutism. If Apple valued privacy as much as they say they do, they would take a stand. Lost profits are part of taking a stand.
I still don't see how that original statement is innacurrate.
It's still not clear what anyone gains by them walking away from China.
Sticking by your ethics isn't about what you gain, it is about being honest and trustworthy.
"We slowed down your battery to make your phone last longer"