WASHINGTON — A majority of Supreme Court justices expressed deep skepticism Wednesday about a federal law denying benefits to legally wed gay and lesbian couples, conveying after two days of historic hearings on the institution of marriage a sense that they would declare the law unconstitutional.

During oral arguments over a challenge to the 1996 Defense of Marriage Act, which defines marriage as a union between one man and one woman, Justice Ruth Bader Ginsburg ticked off some of the 1,100 federal benefits the law denies to gay couples who have been legally married in Massachusetts and eight other states: They are not guaranteed family medical leaves, cannot collect spousal Social Security benefits, and cannot file joint federal tax returns and receive a marital deduction.

“With that set of attributes, one might well ask, what kind of marriage is this?” said Ginsburg, interrupting an attorney who argued the law does not violate states’ rights.

As a result of the law's regulations, Ginsburg added, the nation is left with two classes of marriage: “Full marriage and this sort of skim-milk marriage,” she said, drawing laughter from the packed courtroom.

The brief levity belied two hours of tense arguments over one of the nation’s most volatile social issues: same-sex marriage. The tenor of the questioning raised hopes among gay marriage supporters that the court may toss out DOMA, as the law is known, in a decision expected this summer. The arguments followed Tuesday’s hearing over a parallel case concerning the constitutionality of a California referendum banning same-sex marriage.

Several justices Wednesday expressed doubt on whether Congress even can monitor marriage.

“The question is whether or not the federal government, under our federalism scheme, has the authority to regulate marriage,” said Justice Anthony Kennedy, making the point at least five times during the one-hour oral arguments on the merits of the case.

Kennedy’s comments indicate that the fate of the law may hinge less on whether same-sex couples face discrimination and more on whether the power to regulate marriage falls to states or the federal government. Kennedy is widely considered the swing vote on the court.

“It’s a really interesting twist,’’ said Robert Smith, a Suffolk University law professor who teaches about constitutional law and the Supreme Court. “I think he sees this as a pathway to an outcome that is consistent with his view of federalism that does not reach the most controversial question about equal protection. It puts that off for another day, thinking that maybe it’s a little early for the Supreme Court to take a strong stand when we can wait awhile to see what happens in the political process.”

In the meantime, Smith said, the court could use a states’ rights argument to both strike down the Defense of Marriage Act as well as make a very narrow ruling on the California case that would limit the impact to only one state, if it is not dismissed altogether.

Attorney General Martha Coakley of Massachusetts, who attended Wednesday’s arguments and who had led the first state challenge to the Defense of Marriage Act in 2009, said she was encouraged by the justices’ questioning.

“This is a historic moment for the intersection of law and social policy,” Coakley said. “For the lawyers and judges, it’s an argument. For most of the people inside and outside the court, it’s their lives.”

Last May, the US appeals court in Boston granted equal federal benefits to gay couples in much of New England on the grounds that DOMA violates the federal equal protection clause.

The case before the court Wednesday involves an 83-year-old New York widow, Edith Windsor, who was forced to pay more than $363,000 in federal estate taxes after the death of her female spouse because their marriage is not recognized under federal law. The estate tax would not have been owed had Windsor been married to a man.

The court’s more liberal justices attacked DOMA. Justice Sonia Sotomayor questioned the ability of the federal government to single out a class of people it didn’t like — in this case, homosexuals — for discrimination when it comes to benefits. “What gives the federal government the right to be concerned at all at what the definition of marriage is?”

Justice Elena Kagan dismissed claims by Paul Clement, the attorney defending DOMA, that Congress created the law to promote uniformity among states and instead suggested that it was done out of “dislike, fear, and animus.”

She later drew gasps from the audience when she quoted from a 1996 House report that said Congress decided to “reflect and honor a collective moral judgment” and express “moral disapproval of homosexuality.”

“I’m wondering if we’re living in this new world where the attorney general can simply decide, yeah, it’s unconstitutional, but it’s not so unconstitutional that I’m not willing to enforce it,” Scalia said. “If we’re in this new world, I don’t want these cases like this to come before this court all the time.”

President Obama, who last May became the first president to announce his support for gay marriage rights, said he viewed DOMA as unconstitutional. His administration took the unusual position of declining to defend the law in court, leaving that task up to the House Republican leadership, but it still enforced its provisions. President Clinton, who signed the law 17 years ago, when gay marriage was purely hypothetical, recently recommended that it be overturned.

Chief Justice John G. Roberts Jr. also chided Obama for his approach to the law.

“I don’t see why he doesn’t have the courage of his convictions and execute not only the statute, but do it consistent with his view of the Constitution, rather than saying, ‘Oh, we’ll wait until the Supreme Court tells us we have no choice.’ ”

Justice Stephen Breyer, summarizing the argument that the government needs to operate under a uniform rule, whether its DOMA or not, said: “There has been this uniform one man, one woman rule for several hundred years or whatever, and there’s a revolution going on in the States. We either adopt the revolution or push it along a little, or we stay out of it.”

If the court decides that same-sex spouses are legally entitled to receive federal benefits, the law would be relevant in any state that has legalized gay marriage. Currently nine states allow such unions, including Massachusetts, which became the first state to legalize gay marriage in 2003.

A Gallup poll two weeks ago found that a majority of Americans — 54 percent — would vote for a law conferring marriage benefits such as those for insurance, taxes, or Social Security to spouses of federal employees in same-sex marriages. Only 39 percent said they would vote against such a law.

Kris Mineau, president of Massachusetts Family Institute, who was in Washington for a rally opposing gay marriage, said he believes the federal government has every right to affirm marriage as an institution between one man and one woman.

“We have at least 6,000 years of recorded history on our side, and this debate over the last 10 years in retrospect is a flash in the pan,” Mineau said.

The possibility exists that the court would dismiss the DOMA case if it decides it has no jurisdiction over the matter because of the Obama administration’s decision against defending the law. Some observers said such an action would squander an opportunity.

“The court has a really important role here, and its job is to protect minorities,” said Ara Gershengorn, partner with the Boston-based law firm Foley Hoag and coauthor of a friend-of-the-court brief filed on behalf of former cabinet secretaries and other senior administration officials against the Defense of Marriage Act. “It may be that the political process will get there, but the job of the court is to determine if this is violating the constitutional rights of these individuals today.”

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.