What strange bedfellows this referendum makes. Pinch yourself several times at the jaw-dropping spectacle of David Cameron praising workers’ rights alongside Brendan Barber in the Guardian. This is the same prime minister who put crushing trade unions into his manifesto, and tried to railroad it through until the Lords rebelled.

Finishing off trade unions was part of his claim to carry on Margaret Thatcher’s work: it was a legacy monument, alongside shrinking the state to below anything she dared attempt.

While warning of Brexit’s economic threat to jobs, wages and prices, Cameron joins Barber in writing: “Being in Europe has helped deliver many of the crucial rights that underpin fairness at work. Paid holidays, maternity rights, equal treatment for millions of people working part-time, protections for agency workers, even equal pay for women at work: all are guaranteed in Europe and all could be at risk if we left.”

What? Cameron and his party bitterly opposed every one of these measure, and they still do. And if those rights are in peril after Brexit, the risk comes from him and his own party – the very same Conservative party so eagerly trying to break the last rights of trade unions.

Of co urse, he had to call off the dogs and accept the Lords amendments to his flagship trade union bill to have any hope of getting the unions out actively campaigning for remain. Naturally the Brexit lobby is incandescent, accusing Cameron of a dirty deal with the unions. The Telegraph quotes a furious Eurosceptic: “The unions appear to have got a better deal buying policy from a Conservative Government than they ever did from Labour.”

But Cameron had to do it. He needed unions to fund Alan Johnson’s impoverished Labour In campaign, because the Stronger In cross-party group is legally barred from handing any other group any of its copious cash. Cameron can’t win the referendum without Labour, and union, voters. But, as ever, he never thought about that when he tabled the trade union bill.

Instead, he saw it as a quick way to destroy Labour forever by cutting off its backbone trade union funding – with no balancing reform to the increasingly corrupt billionaire funding of his own party. T

The political funds of trade unions would have dried up, as each individual member would have been required to opt-in by signing up by post to a direct debit. The government’s own gleeful estimates said Labour would lose £25m over the parliament; Labour believed it would be a £35m calamity.

New members will still have to opt in, which may reduce funds not contributed to just Labour but to campaigns such as Hope not Hate. This U-turn was inevitable – yet another case of Cameron plumping for a quick crowd-pleaser for his own party – as he did with this wretched referendum itself – without thinking beyond one week’s headlines.

Though much reduced, the trade union bill remains a very nasty piece of work, setting a ballot threshold for strikes that requires a 50% turnout, with 40% of members supporting action – a level of democratic legitimacy most MPs, councillors and virtually no police commissioners reach.

But the government has backed down on a crucial point over banning electronic balloting, which may make it far easier to get members to vote. The Tories used it themselves to select Zac Goldsmith as London mayoral candidate, but banned it for trade union ballots. Now it will be reviewed independently. Let’s hope this leads to electronic ballots for all elections, at a time when so many of the young don’t vote.

Cameron climbed down too on the “check-off” system, whereby union members’ subs are deducted by public-sector employers, which again would have undermined their funding. Cutting paid time for stewards to do their union work would also have crippled their capacity: most employers welcome the quick resolution of disputes on the shop floor.

One clause in the bill remains deeply sinister, with police-state undertones: on any picket line someone has to be designated “leader”, opening up the possibility that they can be picked off, blamed and blacklisted by employers.

This bill is a piece of pure political malice and mischief. Employers were not asking for it, and it was on no agenda except for that of Tory ideologues. Strikes are at a historic low, and trade unions are dismally weak outside the public sector. Even inside the public sector, they have proved vulnerable. Who would believe that the entire public sector would stomach a 10-year freeze and a below-inflation, 1% pay rise, lowering all their living standards?

The government may fear it won’t last – which it certainly won’t if ministers such as Jeremy Hunt try to toughen working conditions within that cap. The lack of trade union heft is reflected in the failure for most households to regain their pre-recession incomes, while top pay soars.

This tale of a bad bill, ill considered and partly withdrawn, shows why Cameron’s departure after the referendum may be rapid, win or lose. The compromises he has had to make with his own beliefs, let alone his party’s, will leave angry, ravening hordes of disappointed Brexiteers thirsty for his blood. How extraordinary and alarming to think we may look back on him as a “moderate” in comparison with whoever the furious ones choose next.