White House Press Secretary Robert Gibbs on Tuesday stood by the Obama administration's decision to defend the Defense of Marriage Act (DOMA), the 1996 law that bans federal agencies from recognizing the legal marriages of gay and lesbian couples.

On Thursday, the administration appealed two federal cases filed in Massachusetts that found portions of the law to be unconstitutional.

“We can't declare the law unconstitutional,” Gibbs said during a press briefing. “Obviously, I think the president enumerates in there, the administration enumerates in there, our belief on this law as we balance the obligations that we have to represent the federal government. The president believes that this is a law that should not exist and should be repealed. But we, at the same time, have to represent the viewpoint of the defendant.”

Obama has been criticized by both gay rights activists and social conservatives for his defense.

Gay marriage backers have called on the president to deem the law unconstitutional and therefore indefensible in court – much like then-Governor Arnold Schwarzenegger refused to defend California's voter-approved gay marriage ban, Proposition 8 – while social conservatives have claimed the president's defense was too weak.

In its filing, the administration called DOMA “rational” because states have yet to adopt uniform rules on gay marriage.

A bill that would repeal DOMA has gained little traction in Congress.