Many states have laws that make noncompete agreements unenforceable beyond a specific time period. In Massachusetts, for example, I'm pretty sure that any covenant not to compete extending for longer than two years is simply not enforceable.
Without doing any research, I wonder out loud if California got sick of clogging the courts with these "blue pencil" cases and passed a law doing away with the need for them. Or, maybe they decided as a matter of policy that the need for tech companies and their employees to move about freely without fear of litigation was a more effective way to foster innovation than to stifle employees' options by overbroad covenants.
Either way, it's not that California doesn't think much of the concept of freedom of contract, but that these noncompetes are frequently just too overbroad, and California has a large concentration of tech jobs.
Also, I don't know what Google's strategy is, but maybe there's some choice of law provision in the noncompete selecting CA as the forum state. Or maybe they have some incredible precedent to rely on that I dont know about. Or maybe they don't have a prayer so they just had to come up with something so crazy that it might just work.