Nigel Farage must have been smiling to himself as he supped his pint of real ale last night. His party has no members of parliament, a situation unlikely to change at the next election, and offers promiscuous and profligate policies that add up to errant nonsense as a platform for government. Yet suddenly he seems to be running the country.

How else can you explain the way all three mainstream parties, panicking as Farage's Ukip insurgency picks up a few points in the polls, are falling over themselves to show they support his tough stance on immigration? Scarcely a day goes by without another apology for past failures, another gimmicky new policy, another sordid attempt to grab headlines.

Today it was the turn of the Tories. The prime minister, using buzzwords beloved by focus groups, announced a raft of restrictions on benefits, social housing and so-called health tourism. The speech bore all the fingerprints of Lynton Crosby, the party's new campaign manager, a proven master in the darkest political arts of exploiting voters' fears.

Never mind that migrants tend to be young and come here to make money, that statistics show they are far less likely to claim benefits than the indigenous population – even after working here for several years. Or that studies have shown they contribute more to the public purse than they take out. Or, indeed, that eastern Europeans I know fly home rather than risk the NHS, even for minor ailments and dentistry.

Nor is there any decent analysis of last month's disastrous Eastleigh byelection. The Tory campaign with a rightwing candidate revolved around immigration, with ceaseless talk of sending back foreign prisoners, cracking down on legal aid abuse and restricting benefits. Yet the party slipped to third place behind Ukip in a seat it once held; all the hardline talk did was revive the nasty-party image and deter moderate voters, while those wanting Ukip voted for the real thing.

Meanwhile, a masochistic Labour party indulges in self-flagellation. It apologises for failing to curb immigration in office instead of explaining that foreigners came here in unprecedented numbers because Britain was booming and played a key role in our success. Their positive contribution to public finances was greater than predicted. Migrants did not increase unemployment, even among unskilled workers, nor make an impact significantly on wages. Yet now Labour, too, talks of constricting benefits, a popular theme because it conjures up two demons: immigrants and welfare scroungers.

Even the Liberal Democrats have joined this rhetorical arms race, ripping apart their threadbare integrity. Nick Clegg last week abandoned his support for an amnesty for illegal immigrants and demanded a discriminatory £1,000 bond for those visiting from "high-risk" countries. All this would do is deter the likes of Nigerians, the fourth-highest overseas spenders in our shops, while preventing huge numbers of Britons from being able to host their relatives for a wedding or family holiday.

Clegg's despicable move highlights how all three parties are twisting themselves into contorted knots, such is their desperation to look tough. So the Liberals propose illiberal policies, Labour targets the poor and the Tories impose bureaucratic and statist solutions. And the voters do not trust any of them. Such scepticism is unsurprising when we learn the UK Border Agency is so incompetent it has a 24-year backlog of asylum and immigration cases. Inadequate border controls render any immigration policies irrelevant. It could also be pointed out that pressures on social housing, for instance, are caused by the long-term failure of politicians to ensure the building of enough new homes. Let us not forget that the real reason for Ukip's corrosive rise is the perceived collective failure of our political classes, not that party's ragtag collection of policies.

Britons think they have a natural right to travel, live and work wherever they want in the world. But amid talk of a global race in which developing nations are surging forward while Europe gazes morosely at its navel, our insecure politicians are proposing isolationist policies that have an impact on national prosperity and indicate hostility to the rest of the planet. They are also guilty of poor long-term politics: this pandering to cheap populism is significantly less liked by younger, more tolerant, sections of the electorate.

For the dwindling numbers of us still retaining faith in Westminster, this is a depressing state of affairs – as most politicians know in their hearts. Every speech has lines praising hardworking migrants, of course, but the overall tone of this cowardly discourse emits a rancid stench. This is fast becoming the most toxic political debate we have endured for decades, one that demeans the protagonists, debases politics and defeats the national interest.