The case originated from a class action lawsuit in 2005.
Numerous University of California students from out of state felt it was unfair to be charged out-of-state tuition when certain illegal immigrant students from California were allowed to pay much lower in-state tuition.
Monday's ruling was a disappointment to the plaintiffs, many of whom are now pursuing careers out of state.
"Giving folks in-state tuition when they don't have citizenship, while denying it to folks who are citizens is kind of weird," said plaintiff Suzanne Byrd. "I don't know exactly what they can do with this degree once they've got it because most places are going to ask for them for their citizenship and proof and this kind of thing."
The state legislature approved the law allowing illegal immigrants to pay in-state tuition as long they attended a California high school for at least three years and graduated from it.
About 10 states have the same rules.
In the ruling, the justices felt this case wasn't about immigration. It was about the rights of states and legislatures to impose restrictions on public university eligibility.
UC was part of the fight to keep the state law intact.
"We are educating undocumented immigrants in our schools and we're investing in them," said Kevin Johnson, dean of the UC Davis School of Law. "They're part of our economy. They're part of our future and some of them may be legalized and become U.S. citizens in the end."
An estimated 25,000 illegal immigrants receive in-state tuition rates in California. The out-of-state students' attorneys say that costs taxpayers $208 million a year, not to mention slots at UC that would otherwise go to students with citizenship.
Some UC students not involved in the lawsuit felt the court made the right decision.
"I happen to think that education should be more of a right, rather than a privilege, because it does no good to have a population that's ignorant," said UC student Emilio Camacho.
Lawyers for the out-of-state students say they plan to appeal this decision to the U.S. Supreme Court, so the battle is certainly not over.