Another remarkable development yesterday in the sad case of Dr Mohamed Haneef, when his legal advisers opted not to post bail, and he was therefore transferred to Wolston Correctional Centre in Brisbane instead of being sent to immigration detention.

The obvious conclusion is that immigration detention — which is, remember, primarily for people who not only haven’t been convicted but have not even been accused of any crime — is regarded as worse than prison, even though in the latter he will be in solitary confinement for 23 hours a day.

The usual rationale for immigration detention is that it’s a regrettable necessity for the protection of the community. People arrive on small boats from who knows where, often with no identification, so they need to be interned while their claims are assessed and proper checks are undertaken on their health, criminal record and so on.

But if this were really the basis for the system, there would be no reason why detention should be like prison, except for the maintenance of security. Inmates would be guarded, but otherwise treated like guests, not prisoners, with all their usual rights of personal movement and social interaction preserved.

In fact, immigration detention is nothing like that. Detention centres are like maximum security prisons, run by the same sort of personnel with the same sort of rules.

This makes plain what the government sometimes admits in its more honest moments: that the purpose of immigration detention is deterrence. The experience is supposed to be unpleasant, to deter other refugees from exercising their legal right to come here to apply for asylum.

The same goes for other sorts of preventative detention, such as the measures now available in most states to keep certain offenders in jail after the expiration of their sentences if they are found to be still “dangerous”. If this was really about the protection of the community, there would be no reason to treat them like prisoners.

But it’s not about protection, and at some level it’s probably not really about deterrence either. It’s about punishment. Governments don’t like asylum seekers, or s-x offenders, or people awaiting trial, and they think they deserve whatever happens to them, regardless of what the law says.

It’s just possible that Dr Haneef’s case will open a few people’s eyes on the subject.