Cut the niceties. Skip the jargon. Let us speak the plain truth, however ugly. What is driving this country headlong into a chaotic and punishing Brexit is a blind desire to cut immigration. That’s why people voted to leave the EU, politicians and pundits tell us. That’s what makes a Norway-style deal impossible, since it would almost certainly allow freedom of movement with mainland Europe – and any prime minister accepting that would be strung up by the press for treachery.

As long as Brexit is a synonym for keeping out foreigners, there can be no hope for meaningful compromise with the rest of the EU. The Lords can inflict endless defeats on Theresa May. An entire dinosaur gallery of has-been politicians can clamber on rice sacks to issue grave warnings. All will be drowned out by this one guttural roar.

Yet the anti-migrant arguments are a toxic alloy of barefaced lies and naked bigotry. None are new. But they were feverishly circulated in the days before the 2016 referendum. This time, crucially, migrants were made scapegoats for the misery caused by the government’s own drastic spending cuts – for a buckling NHS, a cash-starved school system and falling wages.

The definitive guide to how that happened is a study from King’s College London, which analyses almost 15,000 articles published online during the Brexit campaign by 20 news outlets, including the BBC and all the national papers. Despite its thoroughness, the media has barely covered it – perhaps unsurprisingly given what it implies about the state of our press.

Researchers found immigration to be the most prominent issue in the 10 weeks running up to the vote, leading 99 front pages. Of those, more than three-quarters were from the four most virulently leave newspapers: the Sun, the Mail, the Express and the Telegraph. Brexiteers fed their papers’ scare stories about immigration – no matter how scurrilous. Recall how Penny Mordaunt and the Vote Leave campaign claimed that Turkish murderers and terrorists were queueing up to come to the UK. Never mind that David Cameron immediately decried the lie. Never mind that this is the same country for whose tyrant leader Mordaunt, Theresa May and the rest rolled out the red carpet this week. Anything to fling some mud and get a headline.

“When not associated with rape, murder or violence, migrants were often characterised as job stealers or benefit tourists,” observes the academics’ report. So grab-handedly abhorrent were these newcomers that they were simultaneously taking our jobs and stealing our dole money. Or else they were jostling British mothers out of maternity wards and cramming their kids into British classrooms.

Such poisonous stories were happily ventriloquised by Boris Johnson, Liam Fox, Chris Grayling and Michael Gove. Their reward for helping to generate the hatred that will scar this country for years was, naturally, a big job in government. Their targets, on the other hand, have to live in a society in which racial prejudice is not just normalised but tacitly encouraged by cabinet ministers.

Yet time and time again, the politicians’ claims were false. The men and women who have come here from Budapest or Prague are like previous generations of arrivals: young, educated at someone else’s expense and here to work. They aren’t low-skilled labour but what former government economist Jonathan Portes describes as “ordinary, productive, middle income, middle-skilled – the sort of people our economy actually needs”. Study after study has failed to find any evidence of significant undercutting of wages. Far from jumping the queue, analysis published by the Institute for Fiscal Studies shows they are much less likely to be on benefits or in social housing than their UK-born counterparts.

Migrants from eastern Europe pay billions more in taxes to Britain than they take out in public spending. Far from squeezing hospitals and schools, they subsidise and even staff them. Rather than take jobs, they help create them. What has drained money from our public services and held down our wages is the banking crash, and the Tories’ spending cuts. As former Bank of England rate-setter David Blanchflower concludes in a forthcoming book on Brexit and Trump: “Government-imposed austerity has meant their money [migrants’ taxes] has not been used to finance the services they are entitled to, hence the overcrowding.” In one of the most breathtakingly cynical moves of our time, the very same ministers making the cuts looked at the fallout they created – and blamed migrants.

The Tories haven’t created this climate alone, of course. From Tony Blair to Ed Miliband, Labour leaders have marched alongside, muttering about “legitimate concerns” and handing out anti-immigration mugs. Forget about the evidence or leadership or having a backbone. Never mind the surveys showing that however much people dislike immigration in the abstract, they appreciate migrants.

Imagine Labour repealing gay marriage to placate misguided voters, or restricting women from working in order to boost wages for men. You cannot. But torching non-British workers in order to score political points is still deemed acceptable.

As shadow home secretary Diane Abbott observed , the point about pandering to racism – or whatever euphemistic camouflage you want to stick on it – is that it’s a beast whose appetite is never satisfied. One day the target is immigrants without documents; the next it’s a “swarm” of Poles and 100 Indian doctors blocked from taking up their hospital jobs; and by the end of the week it’s 63 of the Windrush generation deported, and countless more plunged into poverty and homelessness.

Having spoken up for migrants during the referendum, Jeremy Corbyn thankfully does not share this same soft racism. But neither is he doing enough to challenge it. Among the six tests Labour’s Keir Starmer has set for Brexit is the familiar dog-whistle about “fair management of migration”.

Labour frontbenchers evidently believe they have to promise a Brexit that is sufficiently racist for the press and the hard right. In the old Blairite days, we’d have called this triangulation – take minority-ethnic support for granted, while wooing leave voters. Whatever it’s called, it’s a tawdry tactic that soon gets rumbled.

The point about opinions is that they can be shifted. Just see what Corbyn’s team has achieved on austerity in two years. What was once an economic orthodoxy is now recognised as a failure – because Labour stood up for both the evidence and its own better instincts. There are plenty of parallels here: a policy dreamed up by the Tory right, to which the left shamefacedly paid lip service; a mounting body of evidence that it was wrong; and at ground level a lasting legacy of stunted and broken lives. Austerity was urgent in 2010, essential in 2015 and is a relic in 2018. Much of the credit for that should go to Corbyn’s party. Now it should do the same with immigration.

Or else, as one Corbynite frontbencher admits: “You can’t keep telling West Yorkshire one thing, and Islington another.” And you won’t avert a hard Brexit until you face down the intolerance that is driving it.

• Aditya Chakrabortty is a Guardian columnist