Certainly don't make the mistake of separating the state from the corporations and their lobbies when assigning blame.
That saiod, pistachios, pomegranates etc are high-value crops, not like the alfalfa the Saudis grow using senior water rights and then ship to feed cows in Saudi Arabia.
The big problem is that California is too chicken to flatten the baroque system of senior and junior water rights because of the decades of litigation that would entail, and at the same time agricultural water is heavily subsidized and there are perverse incentives for farmers not to invest into more efficient irrigation schemes, often simply flooding entire fields.
It’s 2023, stop acting so oblivious.
One party can make a bad deal, but that doesn't mean the other party isn't immoral for taking that deal, especially when it has substantial negative externalities.
The Contracts Clause: The Contracts Clause of the U.S. Constitution (Article I, Section 10, Clause 1)
> No State shall enter into any Treaty, Alliance, or Confederation; grant Letters of Marque and Reprisal; coin Money; emit Bills of Credit; make any Thing but gold and silver Coin a Tender in Payment of Debts; pass any Bill of Attainder, ex post facto Law, or Law impairing the Obligation of Contracts, or grant any Title ...
You could still take it back with eminent domain probably, but would have to compensate I think at current value, not at bad negotiated value from some time ago.