You can't own the beach. And you can't de facto own the beach by buying all the land around it and then restricting access. These were both well-understood when Khosla bought the land. He knew exactly how California interpreted land rights in this particular case.
Land purchases regularly come with both private (contractual) and public (statutory) limitations/restrictions on use.
Landowners are not kings, and private properties are not sovereign borders.
> But then, the state should not have allowed the sale, right?
I guess that's one way the state could react to these sorts of lawsuits. That would be unfortunate, because it'd probably end up meaning that one asshole prevented a whole bunch of reasonable people from buying beachfront views with their hard-earned money.