WASHINGTON — The Supreme Court appeared ready Wednesday to strike down a central part of a federal law that defines marriage as the union of a man and a woman as a majority of the justices expressed reservations about the Defense of Marriage Act on the second day of intense arguments over the volatile issue of same-sex marriage.

Justice Anthony M. Kennedy, who most likely holds the decisive vote, returned again and again to the theme that deciding who is married is a matter for the states. The federal government, he said, should respect “the historic commitment of marriage and questions of the rights of children to the states.”

That suggests that he is prepared to vote with the court’s four liberal members to strike down the part of the 1996 law that recognizes only the marriage of opposite-sex couples for more than 1,000 federal laws and programs. Such a ruling would deliver federal benefits to married same-sex couples in the nine states, and the District of Columbia, that allow such unions.

If the 1996 law stands, Kennedy said, “you are at real risk with running in conflict with what has always been the essence” of state power, which he said was to regulate marriage, divorce and custody.

All four members of the court’s liberal wing questioned the constitutionality of the law, though they largely focused on equal protection principles rather than on the limits of federal power.

Justice Ruth Bader Ginsburg, for instance, said the law effectively created “two kinds of marriage: the full marriage and then this sort of skim-milk marriage.”

Paul D. Clement, who served as solicitor general under President George W. Bush and is defending the law on behalf of House Republicans, argued that the federal government was entitled to use a uniform definition of marriage across the nation.

Clement said the many federal laws and programs affected had originally been passed with the traditional definition of marriage in mind. When Congress approved the Defense of Marriage Act, he said, it was worried that if one state extended the definition to include same-sex couples, it would effectively force other states and the federal government to recognize them, too. Lawmakers were concerned, he said, that “this is a redefinition of an age-old institution.”

Justice Elena Kagan said there was something else at work.

“Do we really think Congress was doing this for uniformity reasons, or do we think the Congress’ judgment was infected by dislike, by animus, by fear?” she asked. She read a quote from the House record at the time the law was passed suggesting that lawmakers wanted to show “moral disapproval of homosexuality.”

Clement said that “just because a couple legislators may have had an improper motive” did not mean there was not a legitimate purpose to the law.

After an appeals court struck down the challenged part of the law, the outcome the administration had urged, the Justice Department nonetheless appealed, saying the issue warranted an authoritative decision from the Supreme Court.

Chief Justice John G. Roberts Jr. and some of the other more conservative justices expressed irritation that the case was before them at all and said President Barack Obama’s stance — to enforce the law but not defend it — contradicted itself.

“I don’t see why he doesn’t have the courage of his convictions” and not enforce the law if he thinks it is unconstitutional, the chief justice said.

There were also questions about whether House Republicans had standing to defend the law. “Nobody is suggesting,” Clement said, “that this is a best-practices situation.” But there did not seem to be a consensus on the bench to avoid deciding the constitutionality of the law.

Dismissing the case on standing grounds would probably have the effect of letting stand the appeals court ruling that threw out the law. But while the conservative justices expressed skepticism that the court should be deciding the matter, Kennedy suggested there was an issue legitimately before them because “it seems to me there’s injury here.”

Wednesday’s case, United States v. Windsor, No. 12-307, concerns two New York City women, Edith Windsor and Thea Clara Spyer, who married in 2007 in Canada. Spyer died in 2009, and Windsor inherited her property.

The 1996 law did not allow the Internal Revenue Service to treat Windsor as a surviving spouse, and she faced a tax bill of about $360,000 that a spouse in an opposite-sex marriage would not have had to pay.

Windsor sued, and in October the U.S. Court of Appeals for the 2nd Circuit, in New York, struck down the 1996 law. The decision was the second from a federal appeals court to do so, joining one last May from a court in Boston.

When the Supreme Court agreed in December to hear her case, Windsor, 83, said she was thrilled. “I wish Thea was here to see what is going on,” she said.

Until 2011, the federal government enforced and defended the law, as is customary for all federal laws.

But in February of that year, Attorney General Eric Holder Jr. announced that he and Obama had concluded that the law was unconstitutional and unworthy of defense in court. Holder added that the administration would continue to enforce the law.

The main argument Wednesday lasted an hour and featured a rematch between Solicitor General Donald B. Verrilli Jr. and Clement, who were adversaries a year ago in arguments over Obama’s health care law.

Verrilli said the 1996 law violated equal protection and gave the example of “a soldier killed in the line of duty” who would not be entitled to “the dignity and solace of official notification to next of kin.”

Windsor is represented by Roberta A. Kaplan, a lawyer in New York. She said the 1996 law enacted a novel form of discrimination “for the first time in our country’s history.”

Kennedy wrote the majority opinions in the court’s two major gay rights cases, Lawrence v. Texas, a 2003 decision that struck down a Texas law making gay sex a crime, and Romer v. Evans, a 1996 decision that struck down a Colorado constitutional amendment that banned the passage of laws protecting gay men and lesbians.

In the Windsor case, two of Kennedy’s central concerns — states’ rights and gay rights — may be said to align, and his questions suggested that he will vote to strike down the law.