Which companies? If you mean Google search, they decided it wasn't worth complying with Chinese laws and left. You may not agree with the specific laws but complying with local laws is a bare minimum requirement for entry into the market of every country. Google even made a second attempt to reenter China, but shut down due to criticism from employees and the US government.