California (well, Alameda county) is underestimating Elon's committment to the mission. The mission is to replace oil-burning cars with electric ones. A shut-down BEV factory does nothing to achieve that goal. Elon wants to let everyone know that Tesla will take big steps to keep the successful accomplishment of the mission #1 priority. This applies to Texas, too, if they want to play games with Tesla later.
The NUMMI factory site only cost Tesla sixty million bucks to acquire - including the huge stamping press that was too expensive for Toyota to move anywhere else. That is why they are there. I know Schwarzeneggar was hanging around in a highly-visible manner at the time of the purchase, but really it was Toyota/GM selling the site for that amount that enabled it.
In the list of U.S. states, Texas is the third-largest market for Tesla. Only Washington and California have bigger sales, and they have huge tax rebates for BEVs. Texas has NO rebates for Tesla cars whatsoever and it's still Tesla's 3rd-largest market. Translation: the dealership new-car-sales monopoly law in Texas is causing NO significant problem for Tesla. Tesla doesn't care if that law is in place or not.
We recently saw in this thread a comparison between houses for similar price in the Fremont area and then in Texas. It doesn't hurt to be able to offer your workers a way to live in a decent house on a decent lot and have money left over to raise a family - versus being packed into a 900sq.ft. dump for $1.5million!!!