David McCullough, the well-known historian, couldn’t sleep. Of course, people in their 80s often experience some form of insomnia, his doctor, Thomas H. Lee, told him. But the pea under McCullough’s mattress was metaphorical, not physical.

The author of Pulitzer Prize-winning biographies of presidents John Adams and Harry S. Truman, among other highly praised works, tossed and turned. Why? Because public figures don’t know American history, don’t understand that despite uncertainties and challenges, “Things worked out — because individuals behaved in certain ways with integrity and resilience. They figured out how to work with other people, and they tried to do the right things.”

So wrote Lee, with his patient’s permission, in a Wall Street Journal commentary nearly two years ago. By the time McCullough spoke at the Library of Congress’ National Book Festival in Washington, D.C., last Labor Day weekend, his anxiety about historical ignorance had expanded from our leaders to the whole country.

McCullough’s main topic was his latest book, “The Pioneers: The Heroic Story of the Settlers Who Brought American Ideals West.” But he confessed that he worried American history isn’t taught much anymore, that subject matter in general does not receive proper attention.

“Eighty percent of our colleges don’t require history courses. That’s wrong,” he said. Declaring that “30 percent of our population is illiterate today,” McCullough faulted teacher education. The U.S. Department of Education and the National Institute of Literacy reported in 2017 that 14 percent of adults read and computed at a third-grade level or below, and 21 percent at fifth grade or below.

“Teachers should not be allowed to major in education,” McCullough said. Rather, “they should major in a subject,” such as history or literature.

Despite public education’s shortcomings, the historian championed it, as did Rev. Manasseh Cutler, Ephraim Cutler, and Rufus Putnam, protagonists in “The Pioneers.” They were among the leaders in late-18th-century settlement of Ohio country. McCullough said such pioneers were responsible for, among other things, the Northwest Ordinance of 1787.

The ordinance mandated that in the territories that would become Ohio, Michigan, Indiana, Illinois, and Wisconsin, there would be freedom of religion, no slavery, and — apparently for the first time anywhere — free public education for all, supported by the sale of government lands. McCullough called the measure “as important as the Declaration of Independence.”

McCullough’s simultaneous criticism and praise of contemporary education ought to continue provoking insomnia. His moving recollections of teachers who shaped him and others two and three generations ago provide no guarantees.

Three horror stories of many: The Intercollegiate Studies Institute’s 2007 survey that found graduating seniors at prestigious colleges and universities knew less American history than incoming freshmen did. The Smithsonian Magazine reported in 2015 that Texas Tech students were a little iffy on what country the United States gained its freedom from and who won the Civil War. Last summer, a panel of California educators concocted a model high school “ethnic studies curriculum” that never mentioned Jews or antisemitism but urged “direct action” against supporters of Israel.

Why the horrors? Perhaps because of pedagogues like the couple in my American history masters program at Ohio State University in the 1970s. Their declared ambition was to get their Ph.D.s and teach that “the United States is the most racist nation on Earth.” So they and their cohort have taught — contrary to the fact that no other nation, certainly not of continental scope and hundreds of millions of people, has persevered, despite chronic prejudices, in integrating a free citizenry of literally global origins.

From Howard Zinn’s Marxist-slanted “A People’s History of the United States” to the latest identity politics tracts, high school and college students often are indoctrinated in an orthodoxy holding that the United States has yet to redeem itself from its founding sins of slavery and Native American extirpation. That its DNA of “life, liberty, and the pursuit of happiness,” plus capitalism, amounts not to a warrant for prosperity and freedom but to “white, male privilege” and minority repression.

Cutler Hall still stands at my undergraduate alma mater, Ohio University. In the late 1960s, images came through the original windowpanes — glass distorted by 150 years of gravity — in waves. Undistorted, a campus gate cites the Northwest Ordinance to the effect that “religion, morality and knowledge, being necessary to good government and the happiness of mankind, schools and the means of education shall forever be encouraged.”

In academia, including teacher education, an illiberal secular fundamentalism severs connections between schools and the means of education and religion, morality, and knowledge. Perhaps only insomniacs can reconnect them.