When the Russian national hockey team lost to Canada, seven to three, in the hockey quarterfinals of the 2010 Winter Olympics in Vancouver, forward Alexander Ovechkin knew it would be bad. “Now the dirt will pour down on us,” he said at the time. The dirt poured down from the very top. “Because of disgraceful performance of our team I’m afraid to approach TV-set,” tweeted Dmitry Rogozin, then Russia’s ambassador to NATO. “How on earth could we have blown it so disastrously in hockey?” Then-president Dmitry Medvedev canceled his trip to the closing ceremony, and the Siberian city of Tomsk held a moment of silence. I was living in Russia at the time, and I had never seen any country take the Olympics so seriously. Everyone I spoke to was shocked and utterly humiliated: It was the first time in Olympic history that Russia didn’t even get to compete for a medal in hockey.

But other Olympic humiliations abounded. Russia failed in that other sacred Russian winter sport, figure skating. The Russian skating pair that was favored to do well in the Olympics had to change their routine, called “Aboriginal Dance,” after it was decried as racist. Yevgeny Plushchenko took only silver and was so upset about it that Vladimir Putin (then the prime minister) had to publicly comfort him, saying, “Your silver is worth gold.” It had to be, because Russia didn’t win that many golds in Vancouver. Even the Netherlands won more gold medals. Russian athletes only brought home 15 medals total, finishing 11th in the medal count, despite being a country that was long seen as an Olympic juggernaut where winter takes up more than half the year.

Shamed and pilloried, the head of the Russian Olympic Committee resigned, and Russian leadership spoke of serious reform. “The place we got in Vancouver is not worthy of our country,” said Vitaly Mutko, the sports minister at the time and a friend of Putin. “We have to do everything we can to restore our leadership in world sports.” He promised to take “personal control” over the preparations for the Sochi Olympics, where the stakes would be far higher and which were just four years away. What if Russian athletes flopped on their home turf? It was a nightmare scenario.

This is how we got to Tuesday’s ban of the entire Russian team and various Russian officials, including Mutko, from the 2018 Winter Olympics, just two months before the opening ceremony, in South Korea. There is a straight line from Vancouver to Pyeongchang, with a sordid stop in Sochi.

* * *

Authoritarian regimes love organized sporting events, like the Olympics, and Russia was one of the initiators of that love affair, back when it was the Soviet Union. For decades, the Kremlin poured money into Olympic sports. It was an important piece of propaganda for both the world and the Soviet home front: We are a superpower and our people are superpeople. Parents eagerly turned over their children to Olympic factories that would make their young ones into athletes who could do their country proud, and get their families a little extra something, be it more food or Western electronics. Olympic events like the famed 1980 hockey match between the Unites States and the Soviet Union—known as “the Miracle on Ice”—offered easy analogies for larger geopolitical struggles. To be a true global power, you had to defeat your enemies in every arena.

Putin, like most people who survived the Soviet Union, never lost that vision of the Olympics as a proxy for geopolitics. It is why the flop at the 2010 Olympics stunned and humiliated Russia as much as it did. Russia looked in the mirror and didn’t like what it saw. It found that despite a decade of unprecedented economic good fortune, of surging oil prices and rising salaries, of the glitz and glamour of its cities, the country was rotten at its core. In the two decades since the collapse of the Soviet Union, its infrastructure had crumbled and was never rebuilt. The glitz, it turned out, was just a patina of false prosperity.

Mutko was unsparing in his assessment when the Olympic delegation returned, humiliated, to Moscow. “There are a lot of problems,” he said in March 2010. “Over the years, we’ve frittered away our sport science and lost our human potential.” He noted that foreign athletes were trained by Russian coaches who had left Russia, and that in many sports, there was no new generation waiting in the wings. “There’s also the problem of doping,” he said. “Some of us can no longer think of preparing athletes without including doping substances. We began to fight doping with more conviction.” All of these, he said, “are systemic problems” and the Sports Ministry was working to solve them. “Neither I nor the Ministry of Sport deny our responsibility for the performance of the Russian team at the Olympics in Vancouver,” he said. “We will do a serious analysis, and there will be changes, both in terms of organization and personnel, on the basis of our experience in Vancouver.”

An analysis did come, just four months later and in the form of an audit from the Russian Treasury. It found that one of the reasons for the Russian failures in Vancouver was Mutko and the way he spent ministerial finances. In fact, Mutko had spent so much money on himself—$1,400-a-night hotel rooms for 20 days, during which he had an astonishing 97 breakfasts—that there was little left for the actual athletes and their support staff, many of whom traveled to Vancouver on their own dime. Mutko may have spoken that spring about his responsibility, but he took none this time. Any big organization will have its problems, Mutko said when the report came out, but “I see a system that’s nearly ideal ... I don’t see a single problem. You couldn’t possibly call 17 fourth-place finishes an ineffective use of funds!”

In other words, with the home-game Olympics just three and a half years away, Mutko had fixed everything—the rotten infrastructure, the lack of incoming talent, the émigré coaches, the widespread doping—in just four months. By the time the closing ceremony began in all its splendor in Sochi in February 2014, the Russian team had won the medal count.

* * *

We now know how Mutko was able to achieve that jump, from 11th place to first, in such a short amount of time: an extensive, state-sponsored doping campaign. After a German documentary interviewed two Russian athletes who had fled Russia and had become whistleblowers about how systematically Russia dopes its athletes, key figures in the world of Russian anti-doping started turning up dead under mysterious circumstances. This prompted Grigory Rodchenkov, the head of the Russian anti-doping agency, to flee, fearing for his life, to Los Angeles and to the director Bryan Fogel. The two had been working together on Fogel’s riveting documentary, “Icarus,” about how easy it is for an athlete to dope and test clean. Rodchenkov, who had been coaching Fogel in his quest to dope for a cycling event and dupe the tests, decided to confess to Fogel, on camera. He also told his story to The New York Times, and then went into U.S. government witness protection.

Rodchenkov ran the lab at Sochi during the Winter Olympics, and what he did there was essentially what he did for Fogel, but on a more massive scale: helping dozens of athletes dope all through the Games while testing negative on every single test. The story he told to the Times and to Fogel would strain the imagination, were it not independently confirmed by two investigations: one by the World Anti-Doping Agency (WADA) and one by the International Olympic Committee (IOC).

Here is the summary of the operation, from the Times:

The director, Grigory Rodchenkov, who ran the laboratory that handled testing for thousands of Olympians, said he developed a three-drug cocktail of banned substances that he mixed with liquor and provided to dozens of Russian athletes, helping to facilitate one of the most elaborate—and successful—doping ploys in sports history.

It involved some of Russia’s biggest stars of the Games, including 14 members of its cross-country ski team and two veteran bobsledders who won two golds.

In a dark-of-night operation, Russian antidoping experts and members of the intelligence service surreptitiously replaced urine samples tainted by performance-enhancing drugs with clean urine collected months earlier, somehow breaking into the supposedly tamper-proof bottles that are the standard at international competitions, Dr. Rodchenkov said. For hours each night, they worked in a shadow laboratory lit by a single lamp, passing bottles of urine through a hand-size hole in the wall, to be ready for testing the next day, he said.

By the end of the Games, Dr. Rodchenkov estimated, as many as 100 dirty urine samples were expunged.

None of the athletes were caught doping. More important, Russia won the most medals of the Games, easily surpassing its main rival, the United States, and undermining the integrity of one of the world’s most prestigious sporting events.

All of this, Rodchenkov said, was overseen by an officer of the federal security services, the FSB, and had the approval of Mutko and Putin.

Rodchenkov told Fogel he was responsible for about half of the gold medals, but that’s only one of the things he felt guilty for, only one of the things he said was motivating him. The other was that he felt guilty for Putin’s semi-surreptitious invasion of Ukraine, which began almost as soon as the Games had ended. If he hadn’t helped Russians win that many medals, Rodchenkov told Fogel, Putin wouldn’t have gotten so overly confident as to invade Ukraine, annex its Crimean Peninsula, and expect no repercussions.

The irony is that both wins ended up being pyrrhic victories.

In invading Ukraine and annexing Crimea, Putin got into an expensive quagmire in the Donbass region of Eastern Ukraine and a peninsula that is nearly impossible to supply with water, electricity, and food. Meant to revive Russia’s imperial glory, the move left Russia sanctioned and isolated from the West that it was trying so hard to impress.

In rigging the Olympics, Putin got what he wanted—a successful event and a winning medal count—but the conspiracy that Russia needed to get there inevitably surfaced, and now 11 of those 33 medalists have been stripped of their prizes. Others will be given medals in their stead at Pyeongchang Olympics. Russian sport officials, like Mutko, are now banned from the Olympics for life. Russian athletes won’t be able to compete in Winter Olympics under their flag—athletes proven to be clean can compete under a neutral flag. In fact, neither the Russian anthem nor the Russian flag will appear in Pyeongchang.

In October, Putin, anticipating the IOC’s decision, said that this would be “a humiliation for the country.” Humiliation, a word echoed by many Russians when the punishment was handed down on Tuesday, the same word in the mouths of so many Russians in the wake of the Vancouver flop. Humiliation is a particular obsession for Putin, the fear of it informing his posturing at home and abroad. Before Americans spoke of making America great again, Russians spoke of Putin raising Russia up off its knees, a two-decade exercise of expunging the humiliation of the Soviet collapse. Sochi and the elaborate doping scheme used there was intended to do just that, to erase the humiliation of Vancouver, to show that Russia had restored its historic glory, to end the international mockery and disdain. Instead, like so many of Russia’s moves under Putin, it achieved the opposite. Yet again, the glitz turned out to be a sloppy front for the rot.

It may have been an impressive, FSB-orchestrated operation, but what did it get them? After Vancouver, Russia may have been smarting with the perceived humiliation of performing below their own expectations—but after Sochi, the Russian flag won’t fly at the next Olympics at all. Russian officials are busy denouncing this kind of Olympic Games as hopelessly “hobbled” and “not even the Olympics,” while others call for a full boycott by the clean Russian athletes. This wasn’t what Sochi was supposed to achieve. This is a humiliation far worse than Vancouver’s; this is pariah status. Except that Russia was already a pariah for its actions in Ukraine and for meddling in America’s 2016 presidential election, both of which made Russia’s position in the world more complicated, not less. If Putin is the omniscient mastermind many Americans imagine him to be, surely he would have anticipated this?

When I was last in Moscow, a military analyst told me that, after two decades of post-Soviet Western mockery, Russia had decided that, since no one in the West was going to love it, at least they’d fear it. But what comes after that, when the consequences set in and the fear turns to loathing condescension? Isn’t that … humiliating?