'Never waste a good crisis" used to be the catchphrase of the Obama team in the runup to the presidential election. In that spirit, let us see what we can learn from official reactions to the WikiLeaks revelations.

The most obvious lesson is that it represents the first really sustained confrontation between the established order and the culture of the internet. There have been skirmishes before, but this is the real thing.

And as the backlash unfolds – first with deniable attacks on internet service providers hosting WikiLeaks, later with companies like Amazon and eBay and PayPal suddenly "discovering" that their terms and conditions preclude them from offering services to WikiLeaks, and then with the US government attempting to intimidate Columbia students posting updates about WikiLeaks on Facebook – the intolerance of the old order is emerging from the rosy mist in which it has hitherto been obscured. The response has been vicious, co-ordinated and potentially comprehensive, and it contains hard lessons for everyone who cares about democracy and about the future of the net.

There is a delicious irony in the fact that it is now the so-called liberal democracies that are clamouring to shut WikiLeaks down.

Consider, for instance, how the views of the US administration have changed in just a year. On 21 January, secretary of state Hillary Clinton made a landmark speech about internet freedom, in Washington DC, which many people welcomed and most interpreted as a rebuke to China for its alleged cyberattack on Google. "Information has never been so free," declared Clinton. "Even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable."

She went on to relate how, during his visit to China in November 2009, Barack Obama had "defended the right of people to freely access information, and said that the more freely information flows the stronger societies become. He spoke about how access to information helps citizens to hold their governments accountable, generates new ideas, and encourages creativity." Given what we now know, that Clinton speech reads like a satirical masterpiece.

One thing that might explain the official hysteria about the revelations is the way they expose how political elites in western democracies have been deceiving their electorates.

The leaks make it abundantly clear not just that the US-Anglo-European adventure in Afghanistan is doomed but, more important, that the American, British and other Nato governments privately admit that too.

The problem is that they cannot face their electorates – who also happen to be the taxpayers funding this folly – and tell them this. The leaked dispatches from the US ambassador to Afghanistan provide vivid confirmation that the Karzai regime is as corrupt and incompetent as the South Vietnamese regime in Saigon was when the US was propping it up in the 1970s. And they also make it clear that the US is as much a captive of that regime as it was in Vietnam.

The WikiLeaks revelations expose the extent to which the US and its allies see no real prospect of turning Afghanistan into a viable state, let alone a functioning democracy. They show that there is no light at the end of this tunnel. But the political establishments in Washington, London and Brussels cannot bring themselves to admit this.

Afghanistan is, in that sense, a quagmire in the same way that Vietnam was. The only differences are that the war is now being fought by non-conscripted troops and we are not carpet-bombing civilians.

The attack of WikiLeaks also ought to be a wake-up call for anyone who has rosy fantasies about whose side cloud computing providers are on. These are firms like Google, Flickr, Facebook, Myspace and Amazon which host your blog or store your data on their servers somewhere on the internet, or which enable you to rent "virtual" computers – again located somewhere on the net. The terms and conditions under which they provide both "free" and paid-for services will always give them grounds for dropping your content if they deem it in their interests to do so. The moral is that you should not put your faith in cloud computing – one day it will rain on your parade.

Look at the case of Amazon, which dropped WikiLeaks from its Elastic Compute Cloud the moment the going got rough. It seems that Joe Lieberman, a US senator who suffers from a terminal case of hubris, harassed the company over the matter. Later Lieberman declared grandly that he would be "asking Amazon about the extent of its relationship with WikiLeaks and what it and other web service providers will do in the future to ensure that their services are not used to distribute stolen, classified information". This led the New Yorker's Amy Davidson to ask whether "Lieberman feels that he, or any senator, can call in the company running the New Yorker's printing presses when we are preparing a story that includes leaked classified material, and tell it to stop us".

What WikiLeaks is really exposing is the extent to which the western democratic system has been hollowed out. In the last decade its political elites have been shown to be incompetent (Ireland, the US and UK in not regulating banks); corrupt (all governments in relation to the arms trade); or recklessly militaristic (the US and UK in Iraq). And yet nowhere have they been called to account in any effective way. Instead they have obfuscated, lied or blustered their way through. And when, finally, the veil of secrecy is lifted, their reflex reaction is to kill the messenger.

As Simon Jenkins put it recently in the Guardian, "Disclosure is messy and tests moral and legal boundaries. It is often irresponsible and usually embarrassing. But it is all that is left when regulation does nothing, politicians are cowed, lawyers fall silent and audit is polluted. Accountability can only default to disclosure." What we are hearing from the enraged officialdom of our democracies is mostly the petulant screaming of emperors whose clothes have been shredded by the net.

Which brings us back to the larger significance of this controversy. The political elites of western democracies have discovered that the internet can be a thorn not just in the side of authoritarian regimes, but in their sides too. It has been comical watching them and their agencies stomp about the net like maddened, half-blind giants trying to whack a mole. It has been deeply worrying to watch terrified internet companies – with the exception of Twitter, so far – bending to their will.

But politicians now face an agonising dilemma. The old, mole-whacking approach won't work. WikiLeaks does not depend only on web technology. Thousands of copies of those secret cables – and probably of much else besides – are out there, distributed by peer-to-peer technologies like BitTorrent. Our rulers have a choice to make: either they learn to live in a WikiLeakable world, with all that implies in terms of their future behaviour; or they shut down the internet. Over to them.