Detention centres and prisons are filled with the poor, the disabled, the marginalised and, often, the completely innocent. The facilities are dirty and overcrowded sites of infection and abuse, and mental and physical illness. If they aren’t shut down, the COVID-19 pandemic will create a health emergency for detainees and anybody in the community who comes into their contact.

Governments across the world are pleading with individuals to practice social distancing and good hygiene. Yet they are refusing to restructure the systems and practices that force people into tightly packed groups in unsanitary conditions.

Self-isolation in prison is a sick joke. Prisoners have no control over how many of them are squeezed into the cells, or what their hygiene conditions are like. Some of the recommended hygiene measures are made impossible by government regulation. For example, hand sanitiser is a prohibited item in most Australian prisons because of its alcohol content.

Prisoners across the world are aware that if COVID-19 enters their cells, it will be uncontainable and they could die. So in recent weeks, prisons have been explosive sites of resistance.

In Italy, young men climbed onto a prison roof, unfurling a banner that read: “PARDON”. On the street below, their loved ones battled with riot police, objecting to the obvious inhumanity: the prisons were rules unsafe for visitors, yet safe enough for people to be left inside. In Colombia, 23 prisoners at La Modelo prison are dead after a protest or breakout attempt this week, prompted by coronavirus fears.

Elsewhere, governments have recognised the potential contagion threat posed by prisons. The Iranian government released 85,000 prisoners from around the country. In New York and Los Angeles – US states with some of the highest prison populations per capita on earth – governments are staggering the release of some prisoners. In Australia, federal and state governments have cancelled all prison visits and are considering releasing “low-risk” detainees.

This throws into stark relief the arbitrary nature of much detention. In Australia, 33 percent of prisoners are on remand – which means they have not even been found guilty of a crime. Sixty-two percent are serving sentences of less than five years. Aboriginal mothers, people with intellectual disabilities and cardiovascular diseases are overrepresented.

There is another group of people behind bars whose only crime is attempting to stay alive. Refugees are forced into camps and cages near national borders and are hidden in major cities across the world.

For example, the Moria refugee camp, located in an olive grove on the Greek coast, is a disaster waiting to happen. More than 20,000 people are crammed into facilities designed for 3,000, with one toilet shared between 1,600 people.

For refugees in the camp, self-isolation means avoiding the long lines to get something to eat. Already, refugees have rioted, demanding to be released. The European Union has made no provision to find emergency, sanitary housing for the refugees. The only ‘“concession” is that German chancellor Angela Merkel has temporarily stopped the deportation of Afghan refugees.

Refugees in Australia are also resisting, knowing that they are left to suffer in ordinary times from preventable illnesses: septicaemia, colds, complicated pregnancies. They know enormous, needless resources are funnelled into incarcerating and demonising them.

At the Mantra Bell hotel in Melbourne, refugees stood together in their cramped hallways on 24 March, holding placards pleading for their immediate release into the community. The placards read: “What is our crime? We do not want to get COVID-19”.

In Brisbane, more than 80 men transferred from Manus Island detention centre have been incarcerated in a Kangaroo Point hotel for months. One Serco guard monitoring the hotel has tested positive for COVID-19. Refugees, of course, cannot choose to “self-isolate” from the notoriously thuggish guards.

The money spent employing private security to bully refugees around the clock should instead be spent providing hospital staff and equipment. Maybe some of those screws should be taught to do something socially useful – like stock supermarket shelves or help deliver food to peoples’ doorsteps.

The government should requisition more hotels – to make sure nobody is living on the street, or to commandeer extra beds for the unwell. If self-isolation is needed, we need to mobilise society’s resources to make sure everyone has a place where they can be safe and clean. Prisons and detention centres around the world guarantee the opposite.