It might be the morally correct choice (I reserve judgment on that) for California to secede from the US, but it's certainly not a good idea pragmatically.
Trump doesn't really have any consistent ideology about most things, but the one thing he never wavers on is his commitment to protectionist trade policy.
If California seceded from the US to spite Trump, Trump will do everything in his power to block commerce between California and the United States. California's economy will tank, and all the tech companies there will be practically worthless.