It is fitting that Steven Spielberg's widely praised "Lincoln" has been released just as same-sex marriage has attracted close attention from both voters and the Supreme Court. More than any other American president, Abraham Lincoln thought deeply about the complex relationship between moral commitments and political constraints.

With respect to slavery, Lincoln's moral conclusions were not ambiguous. In his first debate with Stephen Douglas in 1858, he decried "the monstrous injustice of slavery itself." He proclaimed, "I hate it" -- not least because it "causes the real friends of freedom to doubt our sincerity, and especially because it forces so many really good men amongst ourselves into an open war with the very fundamental principles of civil liberty."

Lincoln insisted that "in the right to eat the bread, without the leave of anybody else, which his own hand earns," the person who is enslaved "is my equal and the equal of Judge Douglas, and the equal of every living man."

For an aspiring senator from Illinois in 1858, these statements were exceptionally bold. About what to do and when to do it, Lincoln was vague and ambivalent. While supporting "gradual emancipation," he insisted that nothing should be done immediately to eliminate the very practice he hated. His explanation? The "great mass of white people" wouldn't support abolition. In his most striking passage, Lincoln added, "Whether this feeling accords with justice and sound judgment, is not the sole question, if, indeed, it is any part of it. A universal feeling, whether well or ill-founded, cannot be safely disregarded."

When politicians defer to "universal feeling," they are often self-interested. Knowing that their electoral lives are on the line, they choose to live. Other politicians defer out of humility, lacking confidence in their own views. But Lincoln was being neither self-interested nor humble. Instead he was emphasizing democratic constraints on the achievement of clear moral imperatives. As he went on to say: "Public sentiment is everything. With public sentiment, nothing can fail; without it, nothing can succeed."

Of course, it is possible to think that Lincoln was wrong. Shouldn't he have called for immediate abolition? Why should "the great mass of white people" have veto power over what may be the most basic human right -- the right not to be owned by another person? If there is an adequate answer, it is that no leader can shove his own moral commitments down the throats of We the People -- and if he tries, he will fail.

These points bear directly on the role of the Supreme Court. In "The Least Dangerous Branch," published in 1962, Yale law professor Alexander Bickel invoked Lincoln to argue that the court must combine high principle with a keen sense of pragmatism. It must be careful about the timing of its own interventions. When society is sharply divided, the court must use its discretion not to decide.

Bickel memorably urged, "No good society can be unprincipled, and no viable society can be principle-ridden." In his view, the court was right to refuse to recognize certain constitutional principles before the nation was ready for them. In this way, Bickel explained the court's otherwise puzzling refusal, in 1955, to strike down bans on racial intermarriage.

If we keep Lincoln's example in mind, we might well believe that for many important questions, it is reasonable for public officials, and particularly federal judges, to proceed cautiously when the nation's moral judgments are changing -- not least when they are moving in the right direction. Suppose that we agree (as I think we should) that it is unacceptably discriminatory to forbid same-sex marriages -- and that this form of discrimination was no less unacceptable in 1992 and 2002 than it is 2012. Does it follow that the Supreme Court should have ruled, in those earlier years, that states must recognize same-sex marriages?

Not necessarily. If the court had required states to recognize such marriages in 1992, or even 2002, it would not quite have rejected a "universal feeling," but it would have acted in blatant defiance of widespread moral judgments. Any such ruling might well have produced a serious backlash and ultimately proved self-defeating. By short-circuiting public discussion, it would have spurred a serious and possibly successful effort to amend the Constitution to ban same-sex marriage.

Things are different today. Since 2010, polls have found that a majority of Americans support same-sex marriage. The once-unthinkable has happened: An American president has announced that he favors state recognition of same-sex marriages. On Nov. 6, citizens of Maryland, Washington and Maine voted to allow such marriages. On the same day, Minnesota voters refused to incorporate the state's existing ban on same-sex marriage into the state constitution. Same-sex marriage is also recognized in Connecticut, Iowa, Massachusetts, New Hampshire, New York and Vermont, as well as the District of Columbia.

There is no national consensus in favor of same-sex marriage, but the national consensus against it has disintegrated.

In less than two weeks, the Supreme Court will decide whether to hear one or more of several cases that bear on the question of whether governments can reserve the institution of marriage to heterosexual couples. This isn't the place for a discussion of the underlying legal issues, which are complex. But in past years, there was a distinctive reason for judicial caution, rooted in Lincolnian thinking about "public sentiment." In light of continuing movements in that sentiment, that particular argument for caution becomes weaker every day.

Cass R. Sunstein is the Felix Frankfurter professor of law at Harvard.