Major U.S. companies do this and it is regarded as normal. So why should China not be entitled to do so?
The foreign web companies should know about the relevant regulations and laws in China. It is their own business to restrict specific actions.