They argued that the ballot measure revised the state constitution's equal-protection clause so dramatically that it should have had legislature approval before being put to voters.
But the seven-strong panel of judges rejected the appeal by a six-to-one majority.
In their ruling, the judges said the campaigners were arguing that it was "just too easy" to amend the state constitution through the ballot process.
"It is not a proper function of this court to curtail that process; we are constitutionally bound to uphold it," the ruling said.
'Victory for democracy'
Gay-rights activists stood outside the San Francisco court shouting "shame on you" after the decision was made public.
CALIFORNIA GAY MARRIAGE
2004 San Francisco begins issuing marriage licences to same-sex couples - a move annulled by Supreme Court months later
May 2008 Supreme Court votes 4-3 to legalise same-sex marriage; introduced in June
November 2008 Voters approve Proposition 8 limiting marriage to heterosexual couples
March 2009 Civil-rights lawyers argue before Supreme Court that referendum is anti-constitutional
May 2009 Supreme Court rules Proposition 8 is constitutional
Some promised to continue their campaign.
"It's not about whether we get to stay married. Our fight is far from over," said 62-year-old Jeannie Rizzo, who was one of the lead plaintiffs.
"I have about 20 years left on this earth, and I'm going to continue to fight for equality every day," she told the Associated Press.
But the court's decision was hailed as a "victory for democracy" by Brad Dacus of the Pacific Justice Institute, a conservative group that supported Proposition 8.
"[The ruling is] a victory for the civil rights of clergy, county clerks and Californians across the political spectrum who did not want to be forced by the government to approve of same-sex marriage," he said.
National 'tug of war'
Before giving their ruling, some judges indicated they would be extremely reluctant to overrule the will of the people as expressed in the vote.
Supporters of Proposition 8 were also out in force
The court should not "willy-nilly disregard the will of the people to change the state constitution as they have in the past", said Judge Joyce Kennard, according to AFP.
Same-sex marriage is currently legal in five states - Massachusetts, the first state to legalise it in 2004, Connecticut, Maine, Vermont and Iowa - but is subject to the continuing national tug of war over the issue.
Analysts say opponents of gay marriage might now set their sights on seeing the law overturned in Iowa.
Like several other states, California allows same-sex couples to enter "domestic partnerships", which afford many of the same rights as marriage.
But activists say such partnerships are not equivalent to marriage.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.