As shock waves ricochet across the country, expect few tears for the prime minister’s downfall. An insignificant apostle of Thatcher, his place in history is assured only as the man who shipwrecked Britain. Just as Lord North is remembered only for losing America, so David Cameron will be for losing our place in Europe.

He appeased the party’s “bastards” who brought down John Major, and let them “bang on about Europe” until they ate him alive. But in the end it was his government’s relentless small-state austerity that tilled the ground for this monumental popular rebellion. He and his chancellor turned recession into social calamity, crushing the pride out of a humiliated working class. Year by year the Guardian has chronicled all those places Cameron’s metropolitan crew ignored, touring those dead high streets with empty shop fronts, where even pound stores and charity shops fail to thrive.

He closed the Sure Starts, libraries, leisure centres and day centres that once helped hold communities together. He accelerated right-to-buy so close-knit estates lost a third of flats, sold off to private landlords to fill with exploited migrant men. He is slicing away the lifeline of tax credits. Councils that once buffered their citizens against hard times are now skeletons of their former selves, half their income gone, a million jobs shed. Where there was already distress, the Cameron government brought woe.

This week Ofsted’s Sir Michael Wilshaw said the results gap between free school meal pupils and the rest has “barely moved” in 10 years. And education turned out be the strongest opinion predictor on Thursday: areas with the fewest graduates voted most strongly for leave. The old were leavers partly because only 7% of 65-year-olds went to university. Half the young now get degrees, so 75% of them voted remain. But the other half have been ignored. Wilshaw says it’s the weight of poverty that drags us down international league tables – and that pigeons have come home to roost.

If Cameron well deserves this humiliating end, we don’t deserve the crew of ultras he leaves in charge. One by one the awful spectre of what’s to come has paraded across our screens: Norman Tebbit, father of all this, John Redwood, Neil Hamilton, Liam Fox, Iain Duncan Smith, Michael Gove and Boris Johnson, with a triumphant, “We have a glorious opportunity!” Nigel Farage will set out to carve an anti-immigrant role for himself to the right of these. Watch them abandon the Human Rights Act and deny climate change. All are NHS sceptics and BBC detesters.

Soon those leave voters will find they were swindled. The foreigners will still be there. No new homes, hospital appointments or nursery places freed up by a migrant exodus. Hours after the count the Conservative MEP Daniel Hannan admitted there was no £350m a week to spend on the NHS, not for years – and Farage regrets that pledge was ever made. When leavers find there’s no money and no exodus, that it was all lies, where does their wrath turn next?

Buyers’ remorse will set in. With 48% voting against this national self-harm, it only takes a few leavers to change their minds to shift this mood. The pound and markets will be weaker, Scotland likely to depart, and little England’s voice and influence slowly shrinking. Future US presidents will fly over us to the EU: how fitting if Donald Trump is the last candidate to grace us with a visit. Foreign students may prefer elsewhere, scientists and artists will gradually find us less connected, less interesting.

Blame is everywhere in the air, as we thrash about in the agony of this moment. Jeremy Corbyn faces an immediate leadership challenge after a performance that was dismally inadequate, lifeless and spineless, displaying an inability to lead anyone anywhere. What absence of mind to emphasise support for free migration on the eve of a poll where Labour was haemorrhaging support for precisely those metropolitan views. Here was Labour’s golden chance to make this referendum campaign its own. Voters who blocked their ears to Labour on the doorstep this time may head for Ukip, never to return.

Margaret Hodge, who threw down the no-confidence challenge, knows Labour’s peril. In Barking last week I watched this doughty victor over the BNP confront lifelong Labour voters, who would not listen. They had seen good car industry jobs replaced with warehouse work, zero hours contracts and insecurity. But what they hated most was the sudden cultural change with migrants arriving in large numbers in a short time.

“You’re being sold a false prospectus, a bunch of lies,” she warned, when they said migrants were taking their homes and jobs. But to them, the cultural affront outweighed everything else. Identity beat economics. “Labour opened the floodgates,” one said accusingly. Scapegoating, looking for outsiders to blame – perhaps. But if Labour wants to get its voters back, it can’t block its ears as Corbyn, the party’s leader, does. Only 37% in Labour Barking voted to remain, despite London’s 60% vote to stay. Hodge is right that in this existential crisis, Labour could be wiped off much of the national map without a leader strong enough to pull the party back.

Blame will spread far and wide. Tony Blair thought a “modernising” third way meant ignoring old cloth cap Labour. But strong unions were the core, the glue that held together that postwar coalition of intelligentsia and working class. Labour should have encouraged unions into all workplaces, political educators about rights and solidarity. Without them Labour became a cadre of well-meaning graduate MPs motivated mainly by doing good for the poor: admirable – but it let the Tories tell “hardworking families” that Labour wastes their taxes on useless idlers. Labour’s social contract is cracking.

Now the nation’s social contract is broken too. Both parties are riven, but our electoral system blocks the birth of new parties. The seething anti-Westminster wrath must partly spring from 4 million Ukip voters granted just one MP. If Ukip had its fair share of MPs, sunlight would have exposed that quarrelsome ragbag of often nasty eccentrics, just as Hodge saw off Barking’s 12 chaotic BNP councillors. Denying those voters a voice helps explain why those anti-EU, anti-foreigner emotions erupted so disastrously on Thursday.

Is there any waking up from this nightmare, a glimmer of light?