Throughout its history, the ALP has had a habit of getting on the wrong side of major high court decisions — think of the Bank Nationalisation  Case, the Petroleum and Minerals Authority Case and the Political Broadcasting Case (ACTV v Commonwealth). The Coalition has had better luck, with the Engineers’ CaseKoowarta v Bjelke-Petersen and the WorkChoices Case.

But at least in earlier cases, Labor was trying to implement its own policies. It may have been foolish or misguided — indeed I think it usually was — but its MPs were doing something they believed in. Defeat is much easier to bear when you’ve got the consolation that you were trying to do the right thing.

Now we can add Plaintiff M70/2011 v Minister for Immigration and Citizenship, decided on Wednesday, to Labor’s list of High Court failures. But here the consolation is absent; only Labor’s own stupidity, aided by the media’s eagerness to promote that narrative, makes this decision a defeat for Labor at all.

What the High Court has invalidated is fundamentally the Coalition’s policy: the obsession with offshore processing was entirely a creation of the Howard government, and under Tony Abbott it has become ever more strident and ever more central to the opposition’s identity. The Labor government, to its eternal shame, has allowed itself to be dragged along with it.

There’s no reason it had to be like this. Kevin Rudd’s moves to wind back the Pacific Solution did not provoke popular outrage; they were generally accepted as reasonable reforms for which Labor had a mandate. The opposition’s complaints gained traction only when the government itself started to back-pedal.

Once you accept that policy should be driven by a desire not to help the vulnerable, but to punish those who assist them, then you’re engaged in a race to the bottom as to who can be more bloody-minded. Labor was never going to win that race. The Coalition, pushing its island prison of Nauru and the sheer vindictiveness of temporary protection visas, has that ground locked up.

Yet even now, with both sides pushing this demonisation, the public is not convinced. AC Nielsen last month found 53% support for onshore processing; since presumably a large part of the rest are never going to vote Labor anyway, it makes obvious sense for the government to adopt that as its policy.

If it made sense then, it makes even more sense now, for two reasons: first because the High Court has effectively closed off most other options, and secondly because the government’s manifest incompetence makes it clear that it needs to do something to signal a change of direction, a break in continuity.

So why not announce a firm abandonment for ever of the idea of offshore processing, commit to secure, temporary detention of asylum seekers in Australia — in community-based reception facilities, not in prisons — and devote enough resources to rapid processing to ensure that detention is relatively brief. In short, why not appeal to the public’s humanitarianism rather than its paranoia?

It’s not likely to happen; Labor’s powerbrokers will tell the Prime Minister that it would be political suicide. But since the evidence for that is thin at best, and Labor’s prospects are not exactly rosy if it continues on its existing track, something more than ordinary incompetence is required to explain their position.

It’s in neither side’s interests to point it out, but the truth is that Tony Abbott and the people who run today’s Labor party are coming from the same place on this and indeed on most issues. They share the same ideological background, rooted in xenophobia and devoted to a mythical “ordinary Australia” that loathes the very idea of international humanitarian obligations

Julia Gillard, wittingly or not, has become their prisoner. She, or some alternative leader, needs to break free — not just for Labor to have a chance of winning, but for it to retain some shreds of dignity in defeat.