There is a different between taking a loss to fund growth and taking a loss because a market segment is fundamentally unprofitable.
Uber uses the tech startup strategy of funding aggressive growth with VC. This means operating at a loss as long as revenue and the customer base grows.
California is a very mature market for uber. There is little to no growth potential left there, and the government is about to increase the operating cost dramatically. It would make good business sense to pull out of that market.
What complicates matters is that Uber is based in San Fransisco. What kind of power does the state of CA have over companies based in CA but that don't operate in CA?