* Apple has virtually no ability to shape policy in China (at least, in comparison to western democracies) * China (the government, not the people) is not subject to the same limitations as the US government * Apple depends on China for a great deal of things, including manufacturing, and a market for products * If Apple can't manufacture and market it's products in China, it's products become more expensive and less available all over the world. * China passed laws and regulations that demand access to source code
Apple choosing to fight this battle is undoubtedly motivated by the potential business impact of supplying the software that the US government has demanded, and there is no doubt in my mind that if it was a better long term move for Apple, then it's leadership team would concede, and ship the code they were asked for (see: http://www.computerworld.com/article/2472002/endpoint-securi... among other instances).
Apple is using the polarizing nature of the technical details at hand in light of modern concerns about the surveillance state to frame it's argument against what would be a very bad legal precedent that would be disastrous for Apple, and for the tech sector in general.
I don't quite understand where your perceived lack of consistency is - are you implying that Apple didn't try to use every tool at it's disposal to do the best thing for it's investors?