Earlier this month, a Greek court convicted an economist for what amounted to doing his job. In 2010, Andreas Georgiou took over Greece’s statistical agency and revised upward the figures for the country’s debt, which had long been suspect, in order to meet European Union standards. Ever since, Greek officials have tried to blame him for the austerity measures and economic hardship that followed. This month’s verdict, which came after Mr. Georgiou had been repeatedly exonerated, was met with dismay by outside experts who call his work exemplary.

Mr. Georgiou’s case is only the most extreme instance of public vilification of economists around the world. After Bank of England Gov. Mark Carney warned last year that leaving the EU could harm the British economy, one pro-Brexit member of Parliament demanded that he be sacked. When the Congressional Budget Office said this year that replacing the Affordable Care Act would swell the number of uninsured Americans by millions, President Donald Trump’s staff called the nonpartisan agency’s work “fake news.”

Many voters share these politicians’ contempt. More than 40% of Americans completely or partly mistrust federal economic data, according to a poll last October by Marketplace-Edison Research.

The backlash can be traced, in part, to the global financial crisis nine years ago, but the ire doesn’t just stem from anger over the failure of economists to predict or explain that catastrophe. Today, there is a growing chasm between how economists and the public (and its elected leaders) think.

Economists pride themselves on being the most scientific of social scientists. This leads them to reduce all human motives and behavior to quantifiable variables such as utility, welfare and income. But people are not by nature quantitative, and their motives often have no economic basis. Today’s most divisive issues, from fairness and inequality to national identity and culture, don’t have economic solutions.

Greece’s statistics chief, Andreas Georgiou, stands outside his agency’s headquarters, Athens, July 22, 2010. Photo: Petros Giannakouris/Associated Press

Thus, when economists preach the virtues of globalization, market solutions or cost-benefit analysis, they sound to critics on the left like corporate shills lacking any moral anchor. To critics on the right, they sound like globalist elites who despise patriotism.

Yet it is precisely their love of numbers that makes economists invaluable. By stripping the emotions from pressing problems, economists can often illuminate the most practical ways to tackle them—but only if ordinary people and their representatives are prepared to listen.

“ Economics emerged in the 1700s as an offshoot of moral philosophy. ”

Economics emerged in the 1700s as an offshoot of moral philosophy. Known then as political economy, its pioneering practitioners—such as David Hume and Adam Smith—believed that liberating individual self-interest, rather than following religious or political authority, maximized society’s well-being.

Smith made this case most memorably in “The Wealth of Nations” (1776), in which he famously invoked the benevolent “invisible hand” of the free market. But for today’s economists, David Ricardo’s “The Principles of Political Economy and Taxation,” published in 1817, was even more of a breakthrough.

Most people aren’t surprised if a doctor, who could be a better caregiver to her children than a nanny, chooses instead to spend that time seeing patients and pays a nanny out of what she earns. Thanks to Ricardo, economists know that the same principle applies to countries. The average American worker can probably make more tires than a foreign worker, but his edge at producing grain is even greater—and thus the U.S. should export grain and import tires. This theory, known as “comparative advantage,” is both counterintuitive and powerful.

Engravings of pioneering economists David Ricardo (left) and Adam Smith. Photo: Getty Images (2)

Ricardo went further, extolling the pacifying power of free trade: It “binds together, by one common tie of interest and intercourse, the universal society of nations throughout the civilized world,” he wrote. Most economists still agree that globalization fosters political stability and cooperation.

Non-economists have always found this emphasis on material interests and motives somewhat distasteful. In 1790, Edmund Burke, who was friends with Hume and Smith, wrote in “Reflections on the Revolution in France,” “The age of chivalry is gone. That of sophisters, economists, and calculators has succeeded; and the glory of Europe is extinguished forever.”

The influence of economists truly blossomed in the 20th century. The Great Depression gave birth to macroeconomics, the study of how consumption, investment, income and interest rates interact in the aggregate.

In search of better tools to manage the economy, the federal government commissioned economists in the 1930s to calculate gross national product. Convinced that the economy could no longer be left to its own devices, Congress passed the Employment Act in 1946, which established, among other things, a Council of Economic Advisers to provide the president with the necessary expert guidance.

The next year, Paul Samuelson’s seminal book, “Foundations of Economic Analysis,” used mathematics to formalize the key axioms of economics. He touched off a revolution that equipped economists with ever more powerful methods for explaining and analyzing economic behavior. They increasingly adopted the trappings of the physical sciences, hoping to achieve a similar degree of objective truth and predictive power.

Math did clarify economic thinking, but it didn’t improve its forecasting accuracy, which remains dreadful. Virtually no economists predicted the financial crisis of 2007-08 and the recession that followed. Nor has economics rid itself of bias. Economists who advise presidents and prime ministers routinely shape their analyses to validate particular political views.

In recent decades, the stature of economists has taken a beating from two critiques in particular. The first, popular especially on the left, argues that economists are slaves to the assumption that individuals act rationally and in their own best interests. These critics point to psychological and experimental evidence that shows how often people violate the axioms of Econ 101: Our spending and investment habits are often driven by emotions, rules of thumb, ignorance and shortsightedness. The financial crisis seemed to be the ultimate proof, as highly paid bankers and traders, armed with state-of-the-art economic techniques, took on so much risk that they nearly destroyed the global financial system.

“ Economists consider national borders and sovereignty annoying obstacles to the free flow of goods, capital and people. ”

The second critique originates from populist, nativist and nationalist movements in the world’s more prosperous countries. Economists consider national borders and sovereignty annoying obstacles to the free flow of goods, capital and people. The new movements of the right see them as essential preconditions for national identity and cohesion. Many Britons voted for Brexit because control over immigration and their laws mattered more to them than the pecuniary advantages of the European common market.

These trends have fed a broader mistrust of experts and elites. During last year’s election campaign, Mike Pence, Mr. Trump’s vice-presidential running mate, dismissed statistical evidence of the U.S. economy’s health by saying, “People in Fort Wayne, Indiana, know different.” In the months after Mr. Trump’s victory, his team wondered whether it should even appoint a chairman of the Council of Economic Advisers. (The administration eventually nominated Kevin Hassett, a highly regarded economist from the conservative American Enterprise Institute.)

In Greece, economists aren’t simply mistrusted; they’re prosecuted. During the 2000s, Eurostat, the EU’s statistical arm, had repeatedly questioned the accuracy and political independence of Greek statistics. Soaring deficits in 2009 triggered a crisis and forced Greece to seek a bailout in 2010. Mr. Georgiou, a Greek native who received his Ph.D. from the University of Michigan and spent 21 years at the International Monetary Fund, took over Greece’s statistical agency that August. Officials had already shown previous debt and deficit figures to be understated. He revised them further upward and earned for his agency a clean bill of health from Eurostat.

A customer searches for groceries at a supermarket in Caracas, Venezuela, July 25. Photo: Carlos Becerra/Bloomberg News

Politicians of the left and right accused him of inflating Greece’s debts to justify its creditors’ demands for austerity. Prosecutors charged him with making false statements and improperly disseminating statistics without his board’s approval. Courts acquitted him, but the second set of charges was reinstated, resulting in this month’s conviction. Mr. Georgiou, who now lives in a suburb of Washington, D.C., plans to ask Greece’s supreme court for a retrial.

Mr. Georgiou says that his real offense, in the politicians’ eyes, was breaking from the past practice of “resisting” and “negotiating” with outsiders, such as the EU, over what official Greek data would show. The politicians needed a scapegoat to preserve their own “political narratives,” he says. He calls the implications of his case “terrifying” for other professionals responsible for economic statistics.

Economists bear some blame for the public and political backlash. Their disagreement with populist policies has often colored their predictions. British economists, including Mr. Carney, thought that Brexit would unleash so much uncertainty that markets and the economy would tank. American economists foresaw similar swoons if Mr. Trump became president. Both were wrong, at least thus far: Economies in both countries have chugged along, and stock markets in particular have soared. There may be long-term costs, of course, but those may be hard to detect.

“ Economists didn’t predict the financial crisis, but they did help to arrest it. ”

But such misjudgments don’t justify the charges leveled at economists. Take, for example, their inability to predict financial meltdowns. Crises almost by definition are unpredictable. In a recent essay, Ricardo Reis, an economist at the London School of Economics, argues that failing to foretell a financial crash is no more an indictment of economics than failing to predict when a patient will die is an indictment of medicine. Economists didn’t predict the financial crisis, Prof. Reis notes, but they did help to arrest it by applying theory and experience: “The economy did not die, and a Great Depression was avoided, in no small part due to the advances of economics over many decades.”

Another caricature of economists is that they try to emulate physicists, fetishizing elegant, abstract mathematical models disconnected from economic reality. Paul Romer, the chief economist at the World Bank, derisively calls this approach “mathiness.” The critique is certainly fair in some corners of academia, but it is increasingly untrue of the profession as a whole.

In 1963, roughly half the papers published in the top three American economics journals were theoretical, according to a tally by Daniel Hamermesh, now at Royal Holloway, University of London. By 2011, that figure had shrunk to 28%; the remainder were empirical papers based on public data, on data gathered by the authors or on experiments. Economic debates these days are won not by the best theory but by the best data: Statistics are more important than calculus. Economists are far more obsessed with measurement than with math. When public discourse is plagued by innumeracy, this capacity to count is no small thing.

Economists are also instinctively skeptical of simple explanations. They are trained to look for equilibrium, which is another way of saying, “When you change one thing, how do other things respond? Where do things settle once all interactions have occurred?”

Advocates for a higher minimum wage extol the benefits to workers. Economists ask: Will it change employers’ demand for workers who earn the minimum wage? Or what they pay workers who earn just above the minimum? Or the prices they charge, or how much market share they lose to companies that don’t face the higher minimum or how much they invest in automation? Does it reduce turnover and thus make workers more productive?

Advocates of tariffs on imported steel focus on the benefit to domestic steelmakers and their workers. But economists ask: What happens to steel-consuming companies that now face higher prices, as well as to their workers and customers? Does penalizing imports boost the dollar and hurt U.S. exports?

The more data economists collect, the better they can map such complex interactions. Seemingly simple questions seldom have simple answers. A higher minimum wage helps workers in some circumstances but hurts them in others. Tariffs help some workers but hurt many others. Global warming will do some economic harm, but not enough to justify banning fossil fuels.

Sometimes, this attachment to numbers conveys a false precision. Critics say that the Congressional Budget Office overestimated how many people would get insurance under Obamacare and must therefore be overestimating how many will lose it if the law were to be replaced. But the CBO always warned that its estimates were highly uncertain; what no economists doubted, including those working in Mr. Trump’s administration, is that the number would be large. Economists could confidently predict that price controls would lead to shortages in Venezuela, though not how severe they would be.

Non-economists see all this as hopeless equivocation, but it is actually the way that evidence drives science. Economists still have their ideological leanings, but data has helped to restrict these biases. Surveys of top academic economists by the University of Chicago show considerable agreement, even among liberals and conservatives.

For example, the scholars almost all agree that fiscal stimulus reduced unemployment after the last recession and that trade with China benefits Americans by providing them with cheap goods. A study by Gordon Dahl and Roger Gordon of the University of California, San Diego, found that disagreement among economists was greatest where the empirical research was most sparse, as with the issue of whether natural-gas fracking helps U.S. exports.

Though economics remains an imperfect science, it has come a long way in 200 years. Its greatest challenge today isn’t the quality of the analysis it supplies, but whether there is still sufficient demand for it.

Write to Greg Ip at greg.ip@wsj.com