A three-member panel of the California Court of Appeal voted 2-1 to maintain the ban, prompting swift condemnation from gay and lesbian groups who vowed to take their case to state's Supreme Court.
"This decision is a pit-stop on the long road to justice, not a detour," said Jennifer Pizer, a lawyer at Lambda Legal.
In a written verdict that reversed an April 2005 decision by a San Francisco judge which said discriminating against gay marriage was unlawful, the court of appeal said only the legislature was empowered to change the law.
"We conclude California's historical definition of marriage does not deprive individuals of a vested fundamental right or discriminate against a suspect class," the justices said in a 128-page verdict.
"The time may come when California chooses to expand the definition of marriage to encompass same-sex unions. That change must come from democratic processes, however, not by judicial fiat."
The court verdict said California did not in practice discriminate against gays and lesbians because of existing 'domestic partner' laws which give couples almost the same legal rights as married spouses.
California legislators sought to legalise same-sex marriage last year but bill was vetoed by Governor Arnold Schwarzenegger on the grounds that only voters or courts could decide the issue.
