Over the gates of Auschwitz were the words "Work Makes You Free". Over the gates of the Solovetsky camp in Lenin's gulag: "Through Labour – Freedom!". Over the gates of the Ngenya detention camp, run by the British in Kenya: "Labour and Freedom". Dehumanisation appears to follow an almost inexorable course.

Last week three elderly Kenyans established the right to sue the British government for the torture that they suffered – castration, beating and rape – in the Kikuyu detention camps it ran in the 1950s.

Many tens of thousands were detained and tortured in the camps. I won't spare you the details: we have been sparing ourselves the details for far too long. Large numbers of men were castrated with pliers. Others were raped, sometimes with the use of knives, broken bottles, rifle barrels and scorpions. Women had similar instruments forced into their vaginas. The guards and officials sliced off ears and fingers, gouged out eyes, mutilated women's breasts with pliers, poured paraffin over people and set them alight. Untold thousands died.

The government's secret archive, revealed this April, shows that the attorney general, the colonial governor and the colonial secretary knew what was happening. The governor ensured that the perpetrators had legal immunity: including the British officers reported to him for roasting prisoners to death. In public the colonial secretary lied and kept lying.

Little distinguishes the British imperial project from any other. In all cases the purpose of empire was loot, land and labour. When people resisted (as some of the Kikuyu did during the Mau Mau rebellion), the response everywhere was the same: extreme and indiscriminate brutality, hidden from public view by distance and official lies.

Successive governments have sought to deny the Kikuyu justice: destroying most of the paperwork, lying about the existence of the rest, seeking to have the case dismissed on technicalities. Their handling of this issue, and the widespread British disavowal of what happened in Kenya, reflects the way this country has been brutalised by its colonial history. Empire did almost as much harm to the imperial nations as it did to their subject peoples.

In his book Exterminate All the Brutes, Sven Lindqvist shows how the ideology that led to Hitler's war and the Holocaust was developed by the colonial powers. Imperialism required an exculpatory myth. It was supplied, primarily, by British theorists.

In 1799 Charles White began the process of identifying Europeans as inherently superior to other peoples. By 1850 the disgraced anatomist Robert Knox had developed the theme into fully fledged racism. His book The Races of Man asserted that dark-skinned people were destined to be enslaved and then annihilated by the "lighter races". Dark meant almost everyone: "What a field of extermination lies before the Saxon, Celtic and Sarmatian races!"

Remarkable as it may sound, this view soon came to dominate British thought. In common with most of the political class, W Winwood Reade, Alfred Russell Wallace, Herbert Spencer, Frederick Farrar, Francis Galton, Benjamin Kidd and even Charles Darwin saw the extermination of dark-skinned people as an inevitable law of nature. Some of them argued that Europeans had a duty to speed it up: both to save the integrity of the species and to put the inferior "races" out of their misery.

These themes were picked up by German theorists. In 1893 Alexander Tille, drawing on British writers, claimed that "it is the right of the stronger race to annihilate the lower". In 1901 Friedrich Ratzel argued in Der Lebensraum that Germany had a right and duty, like Europeans in the Americas, to displace "primitive peoples". In Mein Kampf, Hitler explained that the German empire's eastward expansion would mirror the western and southern extension of British interests. He systematised and industrialised what imperial nations had been doing for five centuries. The scale was greater, the location different, the ideology broadly the same.

I believe that the brutalisation of empire also made the pointless slaughter of the first world war possible. A ruling class that had shut down its feelings to the extent that it could engineer a famine in India in the 1870s in which between 12 million and 29 million people died was capable of almost anything. Empire had tested not only the long-range weaponry that would be deployed in northern France, but also the ideas.

Nor have we wholly abandoned them. Commenting on the Kikuyu case in the Daily Mail, Max Hastings charged that the plaintiffs had come to London "to exploit our feeble-minded justice system". Hearing them "represents an exercise in state masochism". I suspect that if members of Hastings' club had been treated like the Kikuyu, he would be shouting from the rooftops for redress. But Kenyans remain, as colonial logic demanded, the other, bereft of the features and feelings that establish our common humanity.

So, in the eyes of much of the elite, do welfare recipients, "problem families", Muslims and asylum seekers. The process of dehumanisation, so necessary to the colonial project, turns inwards. Until this nation is prepared to recognise what happened and how it was justified, Britain, like the countries it occupied, will remain blighted by imperialism.

• Twitter: @GeorgeMonbiot

• A fully referenced version of this article can be found at www.monbiot.com