One of the dissenting judges said the legislature should either be required to adopt civil unions or marriage. The other two said that the case should be sent back to the lower court for a trial to see if government has a good enough reason to bar same-sex couples from marriage.
The majority opinion said that while the court agrees that marriage is a fundamental right, it says there is no fundamental right to marry someone of the same sex.
The court also said that although there has been a history of unfair discrimination against gay people, as a group gay people are not politically powerless.
"Our opinion should by no means be read to imply that the General Assembly may not grant and recognize for homosexual persons civil unions or the right to marry a person of the same sex," Judge Glenn T. Harrell Jr. wrote for the majority.
"The court refused to recognize that lesbian and gay couples form committed relationships and loving families just like heterosexual couples," said Ken Choe, a senior staff attorney with the ACLU Lesbian Gay Bisexual Transgender Project who argued the case before the court.
The suit originally was filed two years ago by the ACLU on behalf of the nine same-sex couples and a man whose partner passed away and who would like to be able to marry one day.
In January Baltimore Judge M. Brooke Murdock said that the 1973 law defining marriage as a union between one man and one woman "cannot withstand constitutional challenge."
The ruling was stayed to allow the state to appeal.
In oral arguments last December before the Court of Appeals the state argued that the matter of same-sex marriage should be decided by the legislature not the courts.
"The General Assembly is the proper forum to weigh these issues," said Robert Zarnoch, counsel to the General Assembly.
Ken Choe, a senior staff attorney with the ACLU Lesbian Gay Bisexual Transgender Project disagreed, telling the court that the issue was the state constitution and basic fairness.
"Lesbians and gay couples, who form loving and committed relationships, and who raise children, need and deserve the critical protections that come with marriage," he said.
"The exclusion of same-sex couples from marriage violates the most fundamental guarantees of equality and liberty for all."
Equality Maryland said it was surprised by the high court ruling, given judgments in Massachusetts and New Jersey where courts have ruled same-sex couples must be accorded the same rights as opposite-sex couples.
"We will be pushing for full, legal equality in the Maryland General Assembly," Equality Maryland executive director Dan Furmansky told the Washington Post after the ruling was released.
"This is a social justice struggle. Eventually, Maryland will have civil marriage equality for same-sex couples. It's inevitable."
The issue of same-sex marriage is also before the Supreme Court in California. Oral arguments are expected to be heard late this year or early in 2008.