This is actually how it “should” be. California residents pay the taxes that pay for the UC system.
It’s also the end result of tight budgets and political pressures to keep tuition down for instate students. Out of state (and international) students don’t have the same political leverage. There’s a somewhat legitimate attitude that if they don’t like the price sticker, they can go elsewhere.
Of course, this has made out of state and international students a lot more lucrative for the University, especially those willing to pay full sticker price with no financial aid. This has led to some discussion about how many slots should be reserved for in state students.