Principled or calculating or a bit of both, President Obama’s choice on gay marriage is a bet on the political future — a wager on the views and values of the millennial generation making its long march through American institutions.

It is a group in which Obama still has broad support but which he no longer inspires as he once did. “The Obama generation,” says Brookings scholar William Galston, “lasted about five years.” Those ages 18 to 24 are less enthusiastic about Obama than are those ages 25 to 29. Since 2008, political engagement among millennials has weakened, cynicism toward government officials has increased and skepticism about the value of political involvement has gone up.

Obama’s gay-marriage shift is not likely to change this dramatically. In a recent survey by Harvard’s Institute on Politics, 58 percent of millennials cited jobs and the economy as their issue of top concern. No other topic broke single digits, and cultural issues appeared hardly at all.

But looking beyond a single election, it is undeniable that America is in the midst of a large, consequential shift in the attitudes of the rising generation. A recent poll by the Public Religion Research Institute and the Berkley Center at Georgetown University found millennials to be less religiously affiliated than their parents. A majority thinks that government “is getting too involved in the issue of morality.” While accepting that Christianity “has good values and principles,” millennials often describe it as “judgmental,” “hypocritical” and “anti-gay.”

The pace of these changes is so rapid that sociologists are having a hard time keeping up. In the 2006 data sample that informed the first edition of Robert Putnam and David Campbell’s indispensable “American Grace: How Religion Divides and Unites Us,” 25 percent of 18- to 29-year-olds described their religious preference as “none.” The result of the 2011 sample, printed in the second edition, was 33 percent. In five years, support for gay marriage in that age group went from 48 percent to 60 percent. Those describing premarital sex as “never wrong” went from 34 percent to 44 percent.

If history is any guide, millennial attitudes will grow more conservative over time, at least in some areas. Those who become fathers to daughters will be less inclined to believe that premarital sex is “never” wrong. But the baseline of social liberalism is starting higher than in previous generations, with major political consequences as this cohort works its way through the decades.

It is easy to infer that the Republican Party — as the more religious and culturally conservative party — is doomed in the long run. But long-term political trends don’t apply that neatly. America is not becoming Sweden — though Vermont tries its best. Many millennials hold traditional moral views, as well as politically conservative ones. (A solid majority believes that government has gotten bigger because it has done “things that people should do for themselves.”) Ideology will continue to vary greatly by region. The defining issues of one decade can be overwhelmed or invisible in the next.

But Republicans and conservatives will be forced to make some adjustments over time.

The millennial shift will influence the way conservatives argue. The tone of Michele Bachmann, Rick Perry and Rick Santorum on social issues during the recent primary season — itself a throwback to the early days of the religious right — will not be an option. Republican rhetoric will need to be oriented toward shared moral aspiration instead of harsh judgment.

This trend will influence the coalitions that Republicans build. It will make less and less sense to aggressively alienate groups of voters holding socially conservative values — Latinos in particular — based on other issues. Lost ground among younger, unmarried voters will need to be gained somewhere.

And the generational shift will inevitably influence the fights conservatives choose to make. Even a significant portion of millennials who regard homosexuality as immoral support gay marriage out of a commitment to pluralism. And arguments in favor of pluralism have a tremendous advantage in America. In much of the country, social conservatives may need to choose a more defensible political line — the protection of individual and institutional conscience rights for those who disagree with gay marriage. It is also a commitment of genuine pluralism to allow those with differing moral beliefs to associate in institutions that reflect their convictions.

The immediate political influence of cultural debates is overestimated. But the impact of a generational shift in cultural attitudes is only beginning.

michaelgerson@washpost.com