Earlier quoted context omitted.
There's a question of jurisdiction. Should any country's courts be able to restrict what happens in other countries?
I don't know if they should, but de-facto they can. American companies are, for instance, forbidden from doing business within Iran, North Korea, etc. Likewise, nothing stops the US from passing an enforcing a law that requires any foreign companies that do business with the US to follow US laws, even in their operations outside the US.
The Iran example is due to political trade embargos, which apply not only unilaterally to all companies but are also often a part of international trade agreements via NATO, the UN, and the EU. It's a very different nature than the CA ruling in this case.
The second example, they can't actually pass that law. They can have requirements that companies must comply with to get/keep government contracts, but that is very different because the company can stay in the US and simply not try to win a contract.