Beto O’Rourke has taken the measure of America and found it wanting.

“This country, though we would like to think otherwise,” he intoned last weekend, “was founded on racism, has persisted through racism and is racist today.”

This is now a mainstream sentiment in the Democratic Party. Bernie Sanders said earlier this year that the United States was “created” in large part “on racist principles.”

The New York Times has begun its so-called 1619 Project, marking the 400th anniversary of the importation of slaves from Africa.

The series seeks nothing less than “to reframe the country’s history, understanding 1619 as our true founding, and placing the consequences of slavery and the contributions of black Americans at the very center of the story we tell ourselves about who we are.”

It is certainly true that an American nation existed prior to the Declaration of Independence in 1776, and slavery was its great sin, with permutations still felt today. But to pretend that racism is the essence of America and constituted one of the country’s founding principles is an odious and reductive lie.

It doesn’t explain why any reference to slavery was kept out of the Constitution. James Madison, per his notes during the drafting convention, “thought it wrong to admit in the Constitution the idea that there could be property in men.”

The careful avoidance of the term was subsequently used to buttress the position of opponents of slavery from John Quincy Adams to Abraham Lincoln to Frederick Douglass. The great black abolitionist asked, “If the Constitution were intended to be, by its framers and adopters, a slave-holding instrument,” how could it be that “neither slavery, slaveholding nor slave . . . be anywhere found in it?”

The notion of slavery as a founding principle doesn’t explain the passage of the Northwest Ordinance in 1787, prior to the adoption of the Constitution, setting out the terms of settlement in the swath of territory between the Great Lakes and the Ohio River. It stipulated that “there shall be neither slavery nor involuntary servitude in the said territory.”

It doesn’t explain why the Constitution permitted the prohibition of the slave trade as of 1808, when it was indeed prohibited.

Of course, in crucial respects the Constitution was indeed a compromise with slaveholders. It isn’t clear why it would be considered better if, in the absence of such a compromise, slave states had possibly gone their own way to create a rump nation-state wholly devoted to slavery and not yoked to a North that became more anti-slavery over time.

Rather than enhancing the moral standing of slavery, the Founding tended to undermine it.

“The Revolution suddenly and effectively ended the cultural climate that had allowed black slavery, as well as other forms of bondage and unfreedom, to exist throughout the colonial period without serious challenge,” the historian Gordon Wood writes. In his view, it set in motion the “ideological and social forces” that eventually led to the Civil War.

In the broadest gauge, it’s a mistake to treat the United States as an outlier in terms of its racial attitudes, when it was really an outlier in its (imperfect) embrace of liberty.

“Europeans did not outdo others in enslaving people or treating slaves viciously,” the late historians Elizabeth Fox-Genovese and ­Eugene Genovese observe. “They outdid others by creating a Christian civilization that eventually stirred moral condemnation of slavery and roused mass movements against it. Perception of slavery as morally unacceptable — as sinful — did not become widespread until the second half of the eighteenth century.

“Today we ask: How could Christians or any civilized people have lived with themselves as slaveholders? But the historically appropriate question is: What, after millennia of general acceptance, made Christians — and, subsequently, those of other faiths — judge slavery an enormity not to be ­endured?”

It’s not a question anyone running in the Democratic presidential primaries, or editing The New York Times, is inclined to ask.

Twitter: @RichLowry