Revelations about the Immigration Department’s treatment of children in detention point to one of the most serious failings in Australian public policy in years. The head of the department, Martin Bowles, should be facing dismissal if the appalling state of conditions in which children are being detained, and departmental efforts to cover them up, are confirmed.

The long list of examples of failures in medical treatment provided by health professionals at yesterday’s Human Rights Commission hearing into the detention of children amounts to a serious abrogation of Australia’s duty of care to those it detains. The list includes removing medication from arriving asylum seekers and failing to replace it, in some cases for serious conditions; removing items such as glasses and hearing aids and not replacing them; a lack of basic medical equipment and pharmaceuticals, the withholding of medical records from health professionals, and even a lack of soap for basic sanitation.

And that only relates to the physical health of the detained children. There are also manifestly widespread mental health problems among them, and frequent incidents of self-harming. It was in relation to mental health that the most serious allegation was made yesterday, by Dr Peter Young, a former officer for healthcare provider International Health and Medical Services (IHMS): that the Immigration Department had demanded information about the appalling level of mental health problems on Christmas Island be withdrawn.

Having taken a decision to detain children, in some cases indefinitely, the government owes them a duty of basic care. The mental health problems of long-term detention are well known. There was a parliamentary inquiry into Immigration detention in 2011 that studied the issue in detail. IHMS is, according to that committee, contracted “to provide health services to detainees at the standard available in the general Australian community”. But evidence to the inquiry showed the contracted provider, IHMS, struggling with the challenges of providing adequate mental health services on Christmas Island.

“The conditions provided for children in detention are bad enough that children would be removed for their own protection if the same conditions were found in Australia.”

The mental health impacts of detention also informed the work of the 2012 independent panel of Angus Houston, Paris Aristotle and Michael L’Estrange. In recommending offshore processing on Nauru, they recommended that “appropriate physical and mental health services” be provided with “monitoring of care and protection arrangements by a representative group drawn from government and civil society in Australia and Nauru”. When the Gillard government reopened the Nauru detention centre, Crikey reported on the problems for IHMS in providing adequate mental health services there.

There is, therefore, no possible reason why the Immigration Department should not be aware of both the need to ensure adequate mental health treatment for long-term detainees, and the difficulties of doing so. Officials have had at least three years since the 2011 committee report to work out ways to ensure IHMS provides adequate mental health services. Judging by the evidence both in relation to female detainees self-harming on Christmas Island and that which has emerged in relation to children on Christmas Island and Nauru, the department has manifestly failed.

The failure extends to the provision of basic physical health services. But there’s never been evidence that there is some fundamental difficulty about getting antibiotics, or basics like soap, to Christmas Island or Nauru, or about replacing medication for a child with epilepsy or replacing a hearing aid or glasses taken from them (for some reasons presumably known to Immigration, but otherwise a mystery). The conditions provided for children in detention are bad enough that children would be removed for their own protection if the same conditions were found in Australia. And this is also the department that has overseen the murder of Reza Barati.

It’s a legitimate question, therefore, about whether Immigration’s failure is a deliberate policy to inflict misery on detainees. That’s a question Bowles professed to be offended at when it was put to him yesterday. But the only possible alternative is that his department is incompetent and has been incompetent for a long period.

Now there is an allegation it has sought to cover up its incompetence or malice. It remains an allegation only, but if true it would be of a piece with the systematic and absurd obsession with secrecy that now attends any official discussion of asylum seeker matters. Bowles has been an enthusiastic participant in this secrecy. It’s even possible that the department’s culture of secrecy has backfired on the Immigration Minister, with Scott Morrison now looking ignorant and foolish for trying, presumably on the basis of departmental advice, to dismiss claims about the conditions of detainees as “sensational”.

The government’s determination to “stop the boats” does not require abuse or negligence of detainees as some sort of warning to those contemplating trying to reach Australia. The point is asylum seekers will never be resettled in Australia and will be detained offshore until their claims are determined and a resettlement destination found. That is the deterrent, plus whatever deterrent value can be obtained from the expensive and diplomatically dangerous mechanism of sending boats back to Indonesia. While we detain them, especially children — who have made no decision to attempt to come to Australia — we have a duty of basic care that Martin Bowles’ department appears to have abrogated. And if Bowles can’t do his job, he should be replaced.