It takes a lot for a television show to beat Downton Abbey in the U.K. ratings, especially when it’s a docudrama about accounting. But Mr. Bates vs. the Post Office, a story of online bookkeeping systems, has become one of the most popular television series ever screened in Britain and without doubt the most impactful.

Less than a week after 10 million viewers—one quarter of the adult population of Britain—watched the four-part series, Rishi Sunak, the prime minister, announced he was going to right “one of the greatest miscarriages of justice in our nation’s history.” He told the House of Commons he would bypass the courts and drive through emergency legislation that would exonerate the almost 4,000 men and women who ran branches of Britain’s postal service, the Post Office, and who had been wrongly accused of—and in some cases wrongly jailed for—theft, false accounting, and fraud.

Mr. Bates vs. the Post Office tells the story of a postal worker, Alan Bates, now 69, who led a campaign to clear his and his colleagues’ names. Bates—played by Britain’s favorite hangdog actor, Toby Jones—was accused in 2003 of stealing £1,200 ($1,600) from the small Post Office branch he ran in Wales. He was fired after refusing to cooperate with investigators and lost the business he and his partner had bought with their life savings.

Toby Jones as Alan Bates and Julie Hesmondhalgh as his wife, Suzanne, in Mr. Bates vs. the Post Office.

Bates knew he had not stolen anything and that the accounts that showed the money was missing were wrong. He suspected the Post Office’s new computer system, Horizon, was to blame. He had had trouble using the system to tally his daily takings. It showed deficits and credits that did not match the figures he had meticulously recorded and entered. But how to prove it?

The odds were against him. Back in the early 2000s, the Post Office was one of Britain’s most revered institutions. To this day, its branches are a staple of British life, usually owned by sensible couples with sensible names who wear sensible shoes. Not only do they sell stamps, mail parcels to remote Scottish islands, and have banking services; they often sell homemade cakes and candy for children. “Britain’s most trusted brand,” the Post Office once proudly proclaimed on its Web site.

Post Office investigators had assured Bates that Horizon was “robust” and that no other postmaster had reported any problems with it. So he did the only thing he could in the days before social media proliferated: he wrote to newspapers and magazines to try to get them to investigate.

The Post Office was one of Britain’s most revered institutions.

Rebecca Thomson, a young reporter for Computer Weekly, a small trade publication based in South London, was intrigued. She scrutinized Bates’s claims and published her first report featuring seven different Horizon cases, including that of Bates, in 2009. The Post Office pushed back hard. Thomson recalled receiving a phone call from a Post Office executive, “who just yelled at me, being really aggressive, trying to intimidate me.” When other publications attempted to cover the story, the Post Office denounced Computer Weekly’s reporting as inaccurate. The strength of their reaction spurred Thomson to dig deeper. Soon Britain’s national newspapers, the BBC, and the magazine Private Eye picked up the scent of a scandal. None imagined how big—or how rotten—it would turn out to be.

Thanks to Mr. Bates vs. the Post Office, which draws on thousands of newspaper reports, TV documentaries, and evidence presented to public inquiries, Britons now know that, far from being the happy home of red post boxes, immortalized in the popular children’s TV series Postman Pat, the Post Office has been incompetent, corrupt, and morally bankrupt.

Trouble on the Horizon

In 1999, the U.K. government, the sole shareholder of the Post Office, decided to hire a private-sector contractor to introduce a new national I.T. network to replace the old, inefficient, and expensive paper-based ways of working, as well as to digitally connect its 19,000 branches. The project, which was to cost £1 billion ($1.3 billion), was the largest nonmilitary I.T. project in the world at the time.

Tony Blair—then prime minister—was warned that early tests revealed that Horizon, made by the Japanese technology giant Fujitsu, was faulty. But he pressed ahead, in part, his colleagues recall, to encourage more overseas firms to invest in Britain.

Almost immediately after it went live, software bugs appeared. When postmasters used Horizon to compile their daily and weekly accounts, they often found that even though they had entered the correct figures for income and expenses, the balances the computer generated were incorrect. When they tried to correct the mistakes, the erroneous numbers just got worse.

The real Alan Bates, center, speaks outside the High Court in London.

A postmaster who takes over a Post Office franchise—at a typical cost of £65,000 ($85,000)—agrees to balance their books at the end of each week. If their accounts show a shortfall, they have to make it up out of their own pocket. Horizon indicated some had run up losses in the tens of thousands of pounds in a matter of months. With salaries of around £25,000 ($33,000) a year, none of the postmasters had that kind of cash on hand. In desperation they telephoned Horizon’s helpline. Each time, they were told what Bates had been told: that Horizon was robust, that no other postmaster had encountered any problems with it, and if they did not make up the shortfall a criminal investigation would follow.

It was a wicked lie. The Post Office knew that hundreds of postmasters had reported bugs in the system. It was the start of a 15-year-long campaign by the Post Office to conceal that Horizon was utterly unreliable.

Senior Post Office officials, led by chief executive Paula Vennells—who also served as a part-time vicar—employed thuggish investigators to intimidate postmasters into admitting they had cooked their books, when both the Post Office and the hapless victims knew they hadn’t. The investigators—whose pay was linked to the number of “guilty” pleas they extracted—warned “suspects” that the Post Office would prosecute for theft and they would be jailed. Their only hope of avoiding a custodial sentence was to admit to false accounting.

Paula Vennells, right, the chief executive of the Post Office, opens a new branch alongside its postmaster, Than Thevarajah, center, and Tim Parker, the chairman of the Post Office.

But there was a catch: they would have to agree in writing not to criticize Horizon, and they would still have to pay back any “shortfalls.” Desperate to avoid jail, most pleaded guilty, whether they could pay or not. Overall, 700 people were convicted.

Many went from being local pillars of the community to pariahs. Some were forced into personal bankruptcy and lost their homes. A criminal record makes it hard to find alternative work, so some ended up taking laborer jobs miles from where they lived, and were forced to sleep in their cars between shifts.

Some committed suicide. Fiona McGowan, who was charged with false accounting at a West London Post Office branch she ran with her partner, overdosed on antidepressants and died, aged 47. Cricket-loving Martin Griffiths, 59, who was plunged into depression after plowing £106,000 ($138,000) of his own savings into his branch to make up for “shortfalls,” died instantly when he stepped in front of a speeding bus. The Post Office’s relentless determination to defend Horizon meant the exposure of the scandal was fitful and slow. Sixty other victims died—in many cases their health destroyed by stress—before the truth was revealed.

Many went from being local pillars of the community to pariahs.

Vennells tried to bully critics into silence. Post Office executives lied to BBC investigative reporters looking into Horizon and then threatened to sue them. Fortunately, however, the journalists were not cowed, and their work culminated in an award-winning documentary, Trouble at the Post Office, in 2015. But when the growing clamor over Horizon finally forced Vennells to order an independent investigation by a team of forensic accountants, she used legal loopholes to shut it down when it looked like they might find the root of the problem.

The breakthrough for Bates and the, by now, thousands of others accused or convicted of theft, came in 2019, when a solicitor managed to find investors who were prepared to mount a “no win, no fee” case to try to overturn their convictions. For the first time, the Post Office was forced to reveal documents that showed it had known for years that Horizon was faulty. The judge found that the software was not “remotely robust” and that “bugs, errors and defects” meant there was a “material risk” that Horizon was to blame for the faulty data used to secure convictions. Horizon-related prosecutions were “an affront to the conscience of the court.” An ongoing public inquiry is due to conclude later this year.

Truth in Television

It’s not hard to work out some of the reasons why Mr. Bates vs. the Post Office has been such a success. Everyone loves a David versus Goliath story. But this one is uniquely appealing in a country that still considers itself a bastion of “fair play,” especially when David is a working-class hero whose idea of a good time is a soggy walk in the Welsh hills followed by a pint of warm bitter.

What better villain than Vennells, who ruined lives Monday to Friday and then led services in her local church on Sunday? A villain who, for good measure, accepted an honor from the late Queen for services to the Post Office and charity. (Vennells handed back the award earlier this month after the TV show prompted 1.2 million Britons to sign an online petition calling on her to return it.)

The show’s timing could not have been better. It’s January, no one has any money, the weather across the U.K. is filthy, and everyone is hibernating in front of their TV. (Also, with many now enduring the rigors of Dry January, they are prone to fly into a wild rage at the slightest provocation.)

Jones as Bates, “a working-class hero whose idea of a good time is a soggy walk in the Welsh hills followed by a pint of warm bitter.”

But what really made the drama resonate are the emotional links the British feel toward the Post Office. Many were taught as children to revere it by memorizing the lines of W. H. Auden’s poem “Night Mail”:

Letters of thanks, letters from banks,
Letters of joy from girl and boy,
Receipted bills and invitations
To inspect new stock or to visit relations,
And applications for situations,
And timid lovers’ declarations,
And gossip, gossip from all the nations…

Many teenagers got their first job at the Post Office, either stacking shelves or delivering newspapers. Parents and pensioners collect Social Security payments and apply for driving licenses and passports there. The idea that something wicked could happen at the Post Office was inconceivable. Or, rather, it used to be.

(Although the Post Office, which controls the branch offices of the postal service, and the Royal Mail, which actually delivers the letters and parcels, are separate entities, few in Britain make any distinction between the two.)

What better villain than Vennells, who ruined lives Monday to Friday and led services in her local church on Sunday?

Sadly, for many Brits, the Post Office scandal is just the latest in a series that have shaken faith in the nation’s public institutions. It’s not just that the governing party can’t seem to hold on to a prime minister for more than five minutes, but Britain’s police force, water companies, and energy suppliers, along with the BBC and the National Health Service, have all been tarnished by scandals lately—often the result of the same desire to contract out services and drive down costs that afflicted the Post Office.

Critics on both the left and the right agree it is another example of what has become known as “Broken Britain.” In The Telegraph, commentator Allison Pearson noted: “There was a time in the UK when we could basically take it for granted that our institutions had the best interests of the people at heart. Maybe that was a fond delusion; anyway, we have been cured of it. Too often wronged individuals find themselves pitted against a greedy, useless system which is more interested in reputation management and bonuses than justice.”

But Mr. Bates vs. the Post Office also revealed one positive side to Britain: the country’s traditional media is in ruder health than many thought. Newspapers, magazines, and documentary-makers did the heavy lifting of uncovering the scandal. Then TV dramatists packaged it up into four superb 45-minute episodes, shown on consecutive nights on a terrestrial channel—ITV—for maximum impact. Fittingly for a story about technological overreach, it was a victory for the old way of doing things.

Postage Due

Mr. Bates vs. the Post Office is no postmortem. The saga continues. Another 200 potential victims came forward after the show was broadcast, and the wrongly convicted postmasters are likely to receive compensation of up to £1 million ($1.3 million) each.

Yet no Post Office executive has been punished. The police are investigating potential offenses that could range from dishonesty to perjury or perverting the course of justice. Senior officials testified under oath that Horizon was as secure as “Fort Knox,” as Vennells put it, when they knew it wasn’t. If any are convicted they may be forced to return the multi-million-pound bonuses they were paid.

Vennells, who has said she is “truly sorry for the devastation caused to the sub-postmasters and their families,” collected more than £4.5 million ($5.85 million) in pay, including £2.2 million ($2.9 million) in bonuses, during her seven-year tenure. Compensation payments and corporate fines could exceed £1 billion ($1.3 billion).

In Mr. Bates vs. the Post Office, hundreds of innocent postmasters are wrongly accused of theft, fraud, and false accounting due to a defective I.T. system.

Fujitsu, which has been paid £2.9 billion ($3.8 billion) to date for the Horizon system, has also said it is “truly sorry” for its involvement in the affair and has agreed to contribute to the compensation fund—a decision that wiped $1 billion off the company’s value as its share price fell by 4 percent. But none of its executives have been punished. They may face prosecution for helping the Post Office to take legal action against postmasters that they knew should never have been brought. The firm still works for the U.K. government as a “key strategic supplier,” making more than £100 million ($130 million) annually, and, remarkably, Horizon is still used in Post Office branches. That may not last much longer. The firm has announced it will not bid for any new government contracts until the public inquiry into the scandal is completed.

As for Alan Bates, there are calls for him to be awarded a knighthood. But knowing what he now knows about the British Establishment, he’ll likely decline the King’s invitation when it arrives, courtesy of the Post Office.

Mr Bates vs. the Post Office is streaming now on ITV in the U.K., and on Masterpiece in the U.S. beginning April 7

John Arlidge covers business at The Times of London. He is also a Fellow of the Orwell Prize for Journalism