Gov. Arnold Schwarzenegger had promoted it as a way to generate cash to help fill the state's budget deficit, but opponents argued that selling the properties is unconstitutional and a waste of taxpayer money.
The state is reviewing the court's action and evaluating its options.
It's likely the sale will fall to Gov.-elect Jerry Brown, who takes over Jan. 3.
The Associated Press contributed to this story.