Fifty years ago last week, the Commonwealth Immigrants Act became law. It remains perhaps the most nakedly racist piece of legislation of postwar years.

The background to the law was Kenyan president Jomo Kenyatta’s “Africanisation” policy and his insistence that anyone without Kenyan citizenship faced expulsion. Thousands of Asian Kenyans with British passports decided to leave for Britain. In London, the Labour government panicked, fearing a racist backlash. Home secretary Jim Callaghan, Richard Crossman recorded in his diaries, had come to an emergency cabinet meeting “with the air of a man… [who] wasn’t going to tolerate any of this bloody liberalism”. Callaghan pushed through parliament in three days a law whose sole aim was to prevent Kenyan Asians with British passports from entering this country.

Cabinet secretary Sir Burke Trend acknowledged that Britain would be in breach of international obligations by refusing entry to British nationals. But, he wrote in a memo, “a reasonable case could be put… that the Asian community in East Africa are not nationals of this country in any racial sense”. It only made clearer the racist reasons for the law. The Times commented: “The Labour party has a new ideology. It does not any longer profess to believe in the equality of man. It does not even believe in the equality of British citizens. It believes in the equality of white British citizens.”

We can look upon all this as simply history, albeit a particularly shameful episode. Britain has changed enormously since 1968. The raw, visceral racism that disfigured the nation then is much rarer now.

And yet today’s politicians equally panic about popular anxieties over immigration and seek to assuage it through harsher rhetoric and legislation. Many are happy to proclaim: “We will not tolerate any of this bloody liberalism.” So-called “white identity politics” is defended as legitimate by many mainstream politicians and academics. In 50 years’ time, how will people look upon today’s immigration debates?

• Writer, lecturer and broadcaster Kenan Malik is an Observer columnist