If I were a citizen of the United Kingdom, I would have voted to remain part of the European Union. But I came to that view reluctantly.

The EU has made possible the free movement of goods and people for a population of half a billion people. That’s an amazing accomplishment, and worth defending.

But the EU is also a deeply flawed institution, with a common currency that is continuing to inflict economic misery on millions of people. And in recent years, European elites have showed no sign that they were willing or able to effectively address the EU’s flaws.

Britain’s exit from the EU is a drastic step that will cause some economic suffering in the short term. But it could also help clear the path toward the deep reforms the rest of the member countries will need to undertake to make the EU a viable political unit in the long run.

"And as long as we remain within the EU, we are a blockage upon the EU achieving its proper destiny," British economist Andrew Lilico argued to me in a recent interview. "Because Britain is in the EU — and not part of the common currency — that has meant that the euro has not been able to take control of institutions properly." One result: Eight years after the 2008 financial crisis, unemployment in Greece and Spain is still above 20 percent.

Whether Brexit is ultimately good for Britain and Europe depends a lot on how European leaders react. Britain’s exit creates an opportunity for Europe’s leaders to finally fix the EU’s deep-seated problems. And having a prosperous, stable EU is in Britain’s long-term interest. The big question is whether they’ll take advantage of it.

The euro was a bad idea that has done massive economic damage

The seeds of Brexit were planted on February 7, 1992, when Britain, Germany, France, and other European powers signed the Maastricht Treaty that created the European Union. The treaty addressed many aspects of European integration, but one of the most important provisions concerned plans for a common currency. Most countries committed to trading in their existing currencies for the euro, but Britain negotiated an opt-out.

Many economists thought the euro was a terrible idea. The famed monetary economist Milton Friedman, for example, wrote a prescient article in 1997 explaining why the European Union wasn’t a good candidate for a shared currency. Having different countries use different currencies, he argues, serves as an "extremely useful adjustment mechanism" in times of economic stress. If one country experiences an economic downturn, the value of its currency falls. That reduces the real value of debts — making them easier to pay off — and it makes exports more competitive on global markets.

Friedman noted that adopting the euro meant locking Europe’s economies together in a common economic straitjacket. Without flexible exchange rates to serve as shock absorbers, countries would have to cope with economic downturns using more painful measures like wage cuts and layoffs. And unlike the United States — where everyone speaks English, so it’s easy for workers to move from one state to another — language and cultural differences make people reluctant to move around in search of work.

In 1997, this was a purely theoretical argument, and European officials shrugged it off. But 11 years later, it suddenly stopped being so theoretical. The 2008 financial crisis triggered a sharp economic downturn. And just as Friedman predicted, the euro made it a lot harder for some European countries to adjust.

The 2008 recession was bad everywhere, but countries in the core of Europe — like Germany, France, and Austria — weathered the recession relatively well. In contrast, the recession did horrific damage to countries at Europe’s periphery — especially Greece and Spain — that had adopted the euro. The unemployment rate in both countries soared above 20 percent, where it has been ever since.

If they had their own currency, Greece and Spain would have used devaluations to provide economic stimulus. But stuck in the euro straitjacket, they had to wait for the European Central Bank to provide help instead. And the ECB was so obsessed with keeping inflation low that it never provided the help Greece and Spain needed.

Instead, the ECB actually raised interest rates, a contractionary policy, in 2011. That triggered a double-dip recession and a European debt crisis. While EU leaders were able to cobble together a plan to avoid an outright meltdown, the recession imposed a massive human cost.

The eurozone desperately needs deeper integration

The really scary thing about this is that there’s no guarantee the economic disaster of the past eight years was a one-time problem. The eurozone hasn’t fixed any of the underlying economic problems with the euro. That creates a danger that the next recession will be just as bad as the last one was — with massive unemployment and skyrocketing government deficits in Europe’s weaker economies. Indeed, with more countries set to join the euro in the coming years, there’s a danger that the next recession will be even worse.

Luckily, Britain exercised its right to opt out of the euro and keep the pound, so it was spared the worst of the recession. The UK’s central bank was able to act decisively help the British economy recover after 2008, and as a result it didn’t suffer from a debt crisis or unemployment at the levels seen on the continent. Unsurprisingly, the Brits have looked at the shambles the euro had made of the rest of Europe and vowed never to adopt the common currency.

But the rest of the EU is in a pickle, because it’s extremely difficult to leave the currency once you’ve joined it. Greece discovered this the hard way during last year’s financial crisis. As soon as markets started to worry that Greece might leave the euro and adopt a separate currency, money began fleeing Greek banks, because people knew the new currency would quickly lose value.

If Greece had decided to officially leave the euro, it would have created a months-long economic paralysis, as the banking system totally froze up waiting for new currency to be printed and new payment systems to be developed. Something similar is likely to happen to any other country that tries to leave the eurozone, which means that eurozone countries have essentially handcuffed themselves together and thrown away the key.

What the eurozone needs, then, is to develop the economic institutions that can make the euro work well as a shared currency.

The most important reform is a common, Europe-wide fiscal policy. A big reason that America’s shared currency, the dollar, works well is that most government taxing and spending happens at the federal level. If Michigan is experiencing a bust while Texas is experiencing a boom, the federal government taxes rich Texans to pay unemployment and Social Security benefits in Michigan. These payments act as economic shock absorbers, helping to guarantee that we never see 20 percent unemployment in one state alongside a booming economy in another.

The US also has an integrated banking system backed up by a national central bank; no one worries that fiscal problems in Michigan’s state government will threaten the solvency of Michigan banks, something that happened in Greece. Everyone understands that the Federal Reserve and the Federal Deposit Insurance Corporation guarantee the solvency of banks no matter where they are located.

Brexit makes integration a lot easier

In other words, the EU needs to transform itself from a loose confederation of governments — akin to America’s Articles of Confederation — into a proper government with the full powers of a sovereign state.

One of the biggest problems with this plan was that the British had no interest in participating. And because they had refused to join the eurozone, they had little skin in the game and felt no particular urgency about it.

At the same time, it would have been extremely awkward for the eurozone to try to integrate without Britain. This would have required the other nations to either give Britain a big say in programs it wasn't participating in or create a set of new eurozone-specific institutions parallel to official EU institutions like the European Parliament and the European Commission. Neither option would have worked very well.

In this sense, Britain has done Europe a favor by leaving the EU. Britain isn’t the only EU country not in the eurozone, but it’s by far the largest and most influential.

"Once the UK is out, there will be enormous pressure on other countries to say when they will be joining," Lilico argues. "Countries that refuse to join will get rolled together with Norway," which isn’t in the single market but has a free trade arrangement with the EU. "Then the eurozone can take full control of the EU's institutions and be able to function properly to make it work as a currency union."

Britain’s exit underscores the urgency of integration

Of course, the fact that EU leaders can do this doesn’t mean they will. But Britain’s exit may also prove helpful here as well, by providing a shock that focuses the minds of EU leaders.

The process of British exit will create major economic dislocations both in the UK and on the continent. But those are nothing compared with the problems that will be created if a eurozone country like Greece or Spain is eventually forced to leave the EU in the midst of an economic crisis. The British vote underscores the fact that European leaders have two choices: They can have an orderly process toward deeper integration, or they can risk that a future recession will trigger a disorderly economic collapse of the entire EU structure.

One of the biggest obstacles to deeper integration is the reluctance of wealthier EU countries to see their tax dollars go to subsidize welfare and pension benefits for people in less affluent EU states. So far, German and French taxpayers have been able to fool themselves into believing they can continue with the current situation, in which they enjoy the benefits of free trade with countries like Greece and Spain without paying the costs of full political and fiscal integration.

But the Brexit vote is a reminder that voters won’t put up with a bad situation forever. Britain’s economy is doing much better than some eurozone countries, but voters still got fed up with the EU’s dysfunctional political institutions and its mediocre economic performance. Voters in eurozone countries have been very patient, but they won’t stay patient forever. And once they run out of patience, the result is likely to be even worse than we’re experiencing this week.