> I don't understand why she would be entitled to half given that she did not contribute half
Under California law, all assets acquired after marriage are considered "community property". This means that regardless of who "actually" earned the assets, they are owned by each spouse equally (50/50).
Not all states have this regime, and there are good arguments both for and against the concept. I believe that the strongest argument in favor is that community property prevents power imbalances from developing within a marriage. It is sadly common for a spouse to be trapped in an abusive or unhappy marriage, but who cannot practically escape the relationship because they do not have independent means of support. Community property provides a guarantee of financial support should a marriage dissolve.