Walking through Copenhagen one day last week, my Danish friend pointed out a large and impressive building to me as the headquarters of Denmark’s central bank. I mentally did a brief double-take — isn’t there a European central bank that takes care of that? — before remembering that the coins in my pocket were not euros but Danish kroner, and that Denmark remains outside the eurozone.

The euro has had a bad press lately: economic troubles and subsequent bailouts in Greece, Ireland and Portugal have been widely blamed on the tension between a single monetary policy and divergent fiscal policies. So it’s most unlikely that the Danes will be signing up any time soon. (They negotiated an exception to the Masstricht treaty allowing them, like the UK, to remain out indefinitely.)

But it wasn’t just the idea of a single currency area that was under threat in Scandinavia last week. Another pillar of the European Union, the free movement of people as embodied in the Schengen treaty, was called into question by Denmark’s announcement it would reintroduce border controls on its frontiers with Germany and Sweden.

The response from the EU was swift and to the point. Jose Manuel Barroso, president of the European commission, told the Danish prime minister in a public letter that the proposals “appear to put into question the smooth functioning of Europe’s Single Market and the benefits that an integrated area without internal borders brings for both businesses and citizens”.

Critics of the EU, especially in the “anglosphere”, tend to regard it as a bureaucratic monster whose subsidies and regulations stifle innovation and entrepreneurship. The caricature is not without some truth. But from time to time the EU’s leaders are capable of taking a strong stand for the principles of the free market. Barroso’s remarks are a case in point.

In practice, Denmark’s threat is more a gesture for domestic political consumption than a serious attempt to rebel against the Schengen rules. Travel will remain passport-free, it’s said, and enforcement of the new rules will be confined to occasional customs checks. To go back to a fully controlled Danish border would be a nightmare scenario.

Copenhagen and Malmo, Sweden’s third largest city located just across the Oresund bridge, operate largely as a single metropolitan area. Thousands of people commute between them every day on fast trains running every 20 minutes — despite the differences in language and currency (Sweden also retains its own currency, despite of a theoretical commitment to join the euro). This particular egg could not be unscrambled without huge economic cost.

But that’s just one example of why Schengen is so important. Once people have ordered their work and life patterns on the assumption of free movement, winding that back is going to be highly disruptive. It can also play havoc with the politics of the union: Denmark may claim that its problem is with the Arabs and the Russians, not the Poles and Bulgarians (indeed the claim may even be true, after a fashion), but Poland and Bulgaria will be harder to convince.

In the past few decades, politicians in the developed world have generally resigned themselves to supporting the free movement of goods (despite numerous exceptions in practice), but many still hold out against embracing free movement of people even as a desirable idea, much less as settled policy. How long will it be before Australia allows even visa-free, not to say passport-free, travel from its northern neighbours?

The Schengen treaty is the greatest achievement so far of the view that free trade and open borders have something more than a casual connection. All the more reason for the EU to maintain it as one of the pillars of the European project and to be vigilant against any threat of backsliding.