California is losing so many people because baby boomers are retiring and want to move to less expensive areas.
The question is, then, why is California so expensive? I'd suggest you delve into the concept of supply and demand.
California is so expensive because it's a desirable place to live, i.e,, demand for housing is greater than supply. Do you understand this?