One of the most tragic aspects of writing about gun deaths in America is hearing black parents make the case for why their child should not have been killed. They will impress on you that their children were not gang members, even when you don’t ask. They will make sure you know their kids had never been in trouble with the police, even when it is not relevant. In short they want to make it clear their child was a casualty worthy of your grief and empathy.

There are good reasons for this. Parents want to preserve a cherished memory of their child, and by emphasising good character they accentuate the obscenity of the tragedy. But the primary motivation is to counter the assumption that black youth are feral, lethal and essentially criminal, and if they were shot it’s probably because they deserved it.

For each family this makes sense and can hardly be criticised. But collectively it lends credence to the notion that there are children getting shot who are unworthy of our grief and empathy: the tragedy becomes not that a kid has been shot but that the wrong kind of kid has been shot.

As the British government implodes over the treatment of the Windrush generation we must ensure that the rightful outrage about the exclusion of those who are now, finally, perceived as “worthy immigrants” does not blind us to the outrageous immigration policies that made such exclusion possible and will continue to exclude others deemed “unworthy”.

Theresa May is not apologising for creating a “hostile environment”, expressly designed to spread fear in immigrant communities, when she was home secretary. She is simply conceding that the Home Office has been hostile to the wrong people. The apology, as it stands, is not for the existence of a policy that is unfair, unjust and discriminatory and causes anxiety, penury and despair, but for the ostensible misapplication of it. Over the past week, the official regrets have been too narrowly tailored, the memories too selective, the mendacity too brazen and the callousness too pernicious to see the government’s parsed and partial expressions of remorse as anything other than an insult to our intelligence.

The government has accepted it has made mistakes. The trouble is that it has confessed to the wrong ones. Depriving British citizens of their jobs, healthcare, benefits, pensions, housing and liberty, if they could not provide up to four pieces of documentary evidence for every year they have been here stretching back over 50 years, is not the result of an administrative error. If it had been, it could have been corrected five months ago, when the Guardian broke the first story relating to this scandal. Back in 2014, May did not set out to create a “rigorous” or “stringent” environment, but a “hostile” one in which all migrants would be considered illegal unless they could prove otherwise, and Britain would adopt a “deport first, appeal later” ethos. This is what it looks like.

They were warned. On 30 January 2014 Diane Abbott asked May whether she had considered “the effect that her measures that are designed to crack down on illegal immigrants could have on people who are British nationals, but appear as if they might be immigrants?” They knew they were doing wrong. Virtually every time my colleague Amelia Gentleman wrote about a person’s case, the Home Office would contact their lawyers within a day – sometimes within an hour – of the article going online to say the problem had been resolved.

Last month, when alerted to the case of Albert Thompson, who was denied cancer treatment unless he paid £54,000, even though he’d lived in Britain for 44 years, May said she sympathised but would not intervene because he needed to “evidence his settled status” in the UK. As recently as last week, Downing Street said she would not meet Caribbean heads of state, in London for the Commonwealth heads of government meeting, to discuss the issue.

The mistake the government made was assuming the woes of a few elderly black people born in the Caribbean could not prick the nation’s conscience. They underestimated the pull the Windrush generation could have on Britons’ sense of self. This was not an irrational calculation. When the 2014 Immigration Act that enshrined the “hostile environment” policy was passed, Ukip was riding high in the polls and immigration was the nation’s principal concern. Labour backed the act and only 18 MPs (including Jeremy Corbyn, David Lammy, John McDonnell and Abbott) voted against it. So long as they were talking about “illegal immigrants” and not human beings, that consensus held.

But there is, it turns out, a positive story we can tell ourselves about race and immigration. In the week of the 50th anniversary of Enoch Powell’s “rivers of blood” speech, we have been celebrating the contributions of black foreigners. We have heard about taxes they have paid, the communities they have built, the families they have grown and the way they have changed Britain for the better. We have been talking about immigrants as though they have humanity and about immigration as though it could benefit us.

What is true of immigrants who arrived 70 years ago is true of immigrants today. The fact that these people are being celebrated today is not a product of Britain’s innate sense of fair play. The Windrush generation is far more popular now than it was just after the Windrush docked, when white youths would go “nigger hunting” and signs declared that black people were not welcome in pubs and hostels.

And what is true of racists 70 years ago is true of racists and xenophobes today. Over the past week this ageing cohort has been elevated to the status of national treasure. This has been made possible partly through nostalgia and partly through the affection of the communities in which they have long been embedded, but not least through the constant struggle that continues to be waged for equality.

So long as the government has a policy of hostility towards immigrants, that struggle continues. These laws are not bad because they ensnared the Windrush generation; this just clarified the obscenity and amplified the bigotry on which they were based. They are bad laws because they are designed to turn every Briton – doctor, landlord or teacher – into a border guard, and every migrant, whether they have a right to be here or not, into a suspect. Britain owes the Windrush generation a debt of gratitude. The best way to repay them, after securing the citizenship of all who are entitled to it, is by learning the lessons of the past 70 years rather than repeating the mistakes.

• Gary Younge is editor-at-large for the Guardian. His latest book, Another Day in the Death of America, published by Guardian Faber, is out now. Twitter: @garyyounge