Anyone currently visiting the Royal Docks in London's East End will see an extraordinary display. Sleek grey warships nestle close to the vast Excel exhibition of weapons of mass destruction and repression. Hidden away from the heart of the capital, arms buyers from three dozen nations show why Britain is the world's second biggest defence exporter after America.

Business is booming again following the post-cold war decline. Nor is Britain squeamish about what it sells and to whom. Totalitarian China, Saudi Arabia and Libya are welcomed, their purchases subsidised by the British Treasury if need be.

I am no pacifist and support the right of sovereign peoples to defend themselves, but I cannot see how this festival of weaponry meets any foreign policy goal. It defies Britain's UN obligation to reduce global militarisation, and aids repressive and undemocratic regimes. Britain is helping to make the world a more violent place merely because there is money in it, and "if we don't do it then someone else will" - the smuggler's defence down the ages. Governments can think of good reasons for doing anything, but they rarely step back and wonder if they are promoting liberty, or undermining it.

The philosopher AC Grayling is in no doubt of the answer. He has produced the sort of book that meets Chesterton's test of "forcing a man to change philosophies and religions" through a sharp blow to the head. His weapon is history, presented 18th-century style as a sustained tract - Towards the Light: The Story of the Struggles for Liberty & Rights that Made the Modern West. Grayling argues gloomily that the Whig view of history as a steady progress towards human freedom no longer applies. It reached its climax in the second half of the 20th century with the defeat of fascism and communism. We all cheered and declared that history would die.

No chance, says Grayling. Though much about the world continues to improve - like yesterday's reported fall in child mortality - "we are beginning to descend the far side of Parnassus". Our parents would be amazed that, in peacetime Britain, every public space is monitored by police cameras; private movement is traceable by satellites that follow cars and phones; misbehaving citizens can be imprisoned on the say-so of neighbours; easily readable government ID cards will carry a mass of personal information; suspects are incarcerated indefinitely without trial; and torture has returned to the armoury of the state. They might also find it incredible that 21st-century Britain has revived the 19th-century invasion of distant lands because it dislikes their regimes, or "to spread western values".

Grayling's case is that this swelling infringement of personal liberty is not a minor tweaking of law and order but a loss of freedoms that "cost blood and took centuries" to acquire. They drove Milton to war, Paine to exile and Cobbett to jail. Thousands were slain, burned or tortured to death in their cause. Each retreat from such liberty is defended by home secretaries since "the innocent have nothing to fear". Tell that to the Britons who were held in Guantánamo, none of whom has ever been charged.

The justification for all this is the threat of attack from religious fanatics. Yet, as Grayling points out, this is a criminal menace rather than anything on a par with past strategic threats. While the Islamists may declare their ambition to be a "western caliphate", this is as ludicrously implausible as the dreams of 19th-century anarchists. Modern cities are always vulnerable to explosions, but the west is surely robust enough to withstand any serious threat to the character or constitution of its states. The rantings of Osama bin Laden cannot justify reversing the tide of western liberty. Indeed, while arming against communism helped defeat communism, arming against terrorism only feeds the beast.

The noblest testament to freedom is the American constitution, yet, as Grayling points out, the latest statute passed under its aegis runs contrary to its ethos. The mission of the Patriot Act is "to deter and punish terrorist acts in the United States and around the world, to enhance law enforcement investigatory tools, and for other purposes". Montesquieu and Madison would have been appalled at such generalised statism. Nor are the act's powers temporary, wartime ones; they are permanent, as are Britain's myriad terrorism laws. By extending state power to curb civil liberty they do the terrorist's job (such as it is) for him. Never was Franklin's maxim more apt, that he who would put security before liberty deserves neither. Freedom cannot be strengthened by being weakened. That is the sophistry of dictatorship.

Commentators have ascribed the chaotically belligerent aftermath of 9/11 to weak western leaders craving popularity in the glamour of war. Tony Blair said he "believed passionately that we are at mortal risk" from Islamism. It was the sort of threat that the risk theorist Ulrich Beck describes as "always an elixir to an ailing leader".

I think more sinister forces are at work: those on display in the Royal Docks. In 1953 America's last true soldier/president, Eisenhower, warned of a "military/industrial complex" in danger of running amok. Its wealth could bend democracy to its will, using paranoia to seize control of budgets and policies alike. The outcome would be "a tragic waste of resources ... humanity hanging on a cross of iron", with armies seeking war for their employment. Elected leaders, said Eisenhower, fed such a complex at their peril.

The growth of Islamist terror, always described as "al-Qaida linked" (as international crime was always "mafia-linked"), meets Eisenhower's thesis. With the threat of communism gone, the military/industrial complex needs a new cause. Allied to a booming police and intelligence bureaucracy, it has grasped eagerly at terrorism. It has no interest in keeping that threat in proportion, and every interest in exaggerating it. To cover the bungles that led to 9/11, this security/industrial complex portrayed the terrorists as awesome and ubiquitous, capable of building vast bomb-proof bunkers in the Hindu Kush, fake plans of which were dumped on a gullible press. State security agencies dance to the tune of Oh! What a Lovely War. They enslave the language of freedom in the cause of repression.

Seen in the light of history, I do not find Grayling's alarmism out of order. It is simply true that in Britain and America arms dealers, in league with security bureaucrats, have fuelled public debate with extreme paranoia. Those who defend liberty are accused of appeasing an unseen enemy. Those who plead democracy are accused of threatening the state. If the freedom show is to get back on the road, some battles must clearly be fought over and again.

· The paperback edition of Simon Jenkins' book Thatcher and Sons is published this week by Penguin

simon.jenkins@theguardian.com