The ruling was authored by a judge widely regarded as conservative, Michael Boudin, who was appointed by President George Bush, Sr. However, the three-judge panel's position may be seen as conservative because it emphasizes states rights over federal power by saying that if states are free to ban gay marriage they should also be free to legalize it without interference from Washington.
"Many Americans believe that marriage is the union of a man and a woman, and most Americans live in states where that is the law today. One virtue of federalism is that it permits this diversity of governance based on local choice, but this applies as well to the states that have chosen to legalize same-sex marriage," Boudin said in the ruling.
"Under current supreme court authority, Congress' denial of federal benefits to same-sex couples lawfully married in Massachusetts has not been adequately supported by any permissible federal interest."
Boudin said that the court did not believe that Doma was motivated principally by hostility to homosexuality.
"The many legislators who supported Doma acted from a variety of motives, one central and expressed aim being to preserve the heritage of marriage as traditionally defined over centuries of western civilization," he wrote.
Boudin added that attitudes toward discrimination against minorities have evolved to the point where they are no longer acceptable. He said that for 150 years the "desire to maintain tradition would alone have been justification enough for almost any statute".
"But supreme court decisions in the last 50 years call for closer scrutiny of government action touching upon minority group interests and of federal action in areas of traditional state concern," wrote Boudin.
The appeals court said it recognizes that it would not have the final word and that "only the supreme court can finally decide this unique case".
The case was brought by three surviving spouses of same sex marriages in Massachusetts and seven other same-sex couples after they were denied federal benefits.
The Massachusetts attorney general, Martha Coakley, praised the ruling. "Today's landmark ruling makes clear once again that Doma is a discriminatory law for which there is no justification. It is unconstitutional for the federal government to create a system of first and second class marriages, and it does harm to families in Massachusetts every day," she said.
"All Massachusetts couples should be afforded the same rights and protections under the law, and we hope that this decision will be the final step toward ensuring that equality for all."
The Boston ruling follows a similar decision by a district judge in California last week that Doma is unconstitutional, a further chipping away at the law that is almost certain to see it land before the supreme court within the next year or so.
The legal battle has been complicated by the White House's decision to no longer defend Doma in court. That has forced the Republican speaker of the House of Representatives, John Boehner, to set up the Bipartisan Legal Advisory Group to defend the legislation.
In the California decision last week, Judge Claudia Wilken referred to a 1996 supreme court ruling on discrimination measures in Colorado that found gays and lesbians are protected from "burdensome legislation that is the product of sheer anti-gay animus and devoid of any legitimate governmental purpose".
Wilken also cited the nature of deliberations in Congress which she said showed "evidence of moral condemnation and social disapprobation of same-sex couples".
"The legislative history described above demonstrates that animus toward, and moral rejection of, homosexuality and same-sex relationships are apparent in the congressional record," she wrote.
A Washington Post-ABC News opinion poll published last week found that more Americans than ever support the right of gay couples to marry with 53% in favor and 39% opposed.
Intellpuke: You can read this article by Guardian Washington, D.C., correspondent Chris McGreal in context here: www.guardian.co.uk/world/2012/may/31/court-rules-defense-marriage-unconstitutional