WASHINGTON -
The substantive case against gay marriage collapsed in the Supreme Court last week.

Legally, Supreme Court watchers say, advocates won't win the sweeping victory they once anticipated as they made arguments last week. The court is likely to overturn a California law that precludes same-sex marriage, on technical grounds. The 17-year-old federal Defense of Marriage Act defining marriage as between a man and woman, and thus denying federal spousal benefits to gays and lesbians, almost certainly will be thrown out on the grounds that such decisions should be left to the states.

The upshot: Gay marriage will be legal in 10 states, including California, and the District of Columbia. The battle will continue to be waged by referendum and in state legislatures in the other 40 states, with endless legal challenges.

These struggles will be framed by the two days of arguments before the high court last week. Whatever the legal outcome, there was no contest on the merits: Opponents came across as fighting yesterday's battle against a reality recognized by more and more voters.

The central criticism of same-sex marriage revolved around procreation; that the purpose of marriage is to produce offspring. These critics faltered when asked about infertile couples or senior citizens who get married. If this were a serious basis for policy, the best enforcement mechanism would be fertility tests before granting marriage licenses.

Justice Samuel Alito worried that the question is just too new, that mobile phones and the Internet have been around longer. Same-sex marriages have only been legal anywhere for less than a decade, though gay and lesbian couples have been living together, some with adopted children, for ages. The woman who brought the case against the federal law had been with her now-deceased female spouse since 1967.

Chief Justice John Roberts said proponents were showing inconsistency with their dual claims that children of same-sex marriages fare as well as others and that legal recognition is necessary for the welfare of these kids.

Actually, much research and many experts concur with both points. Last month, the American Academy of Pediatrics, after an extensive review, declared that allowing gay and lesbian couples to marry is in the best interests of children. When critics worry this will lead to more adoptions by gay couples, they ignore that the alternative often is for these children to suffer in orphanages or in a flawed foster-care system.

The chief justice offered a legitimate critique of President Barack Obama - the two aren't fond of one another - wondering why he had continued to enforce the federal statute if he considered it unconstitutional.

It was cringe-inducing, however, when he said politicians were "falling all over each other" to embrace same-sex marriage. Think back a generation, and substitute blacks for gays and lesbians.

There has been a pronounced shift in public and political opinion. Only last year, the Republican platform and presidential candidates were adamantly opposed to same-sex marriage.

It may be that the political potency of gay marriage- bashing in years past - ballot referendums in states such as Ohio, it is often declared, were helpful to President George W. Bush's 2004 re-election - was exaggerated.

"We analyzed the returns and there was no difference in the turnout among social conservatives and evangelicals in states that had gay marriage on the ballot and those that didn't," says Matthew Dowd, who conducted Bush's 2004 polling. "It's an urban myth."

By 2012, the issue had become a political asset for Obama, says his campaign manager, Jim Messina: "It's part of why we got a bigger youth turnout."

The best analogy for last week's arguments isn't the oft- cited Roe v. Wade abortion case or the Brown v. Board of Education civil-rights decision; it's Loving v. Virginia, the 1967 court decision that ruled unconstitutional the state's prohibition on interracial marriage. (Obama, the son of an African man and white American woman, was then 5 years old and living in Hawaii.)

Much as the court now seems likely to defer any definitive ruling on gay marriage this year, back then, it ducked the anti- miscegenation laws for more than a decade.

The more important similarity is the issue of harm or injury. In the abortion controversy, both sides legitimately claim severe harm results from an adverse ruling. No one is legitimately hurt by interracial or gay marriage.

That's why public opinion has changed. The more transparent and open these relationships can be, the more the irrational fears are allayed. The threats to the institution of marriage are divorce and children born to single parents, not gay and lesbian couples.

There's one more analogy to Loving; history is on the side of gay-marriage proponents. The conventional wisdom is that the court will vote 5-to-4 in these cases, with Justice Anthony Kennedy in the role of swing vote. Don't be surprised if Roberts, who is 58 and expects to remain chief justice for a long time, doesn't fight history.