Coronavirus offers the perfect excuse for closing borders. That would be a mistake.

For almost six years now, a network of volunteers in Europe and Africa have been providing a service that some of the world’s wealthiest countries have chosen not to. When migrants get into distress in the Mediterranean, they can call Alarm Phone’s emergency number; the call is relayed by a team of people spread across France, Tunisia, Italy, Germany, the UK, Morocco and elsewhere to the coastguard service nearest the boat.

On the night of 10 April, Alarm Phone received a call from one of 63 people on board a rubber boat drifting between Libya, Italy and Malta that was slowly filling up with water. According to Alarm Phone, the EU was aware of the boat but Malta, the country that should have been responsible for rescuing it, held off until the migrants could be returned to Libya, where torture and other forms of mistreatment are well documented. The boat drifted for five days, during which time five people died of thirst, according to survivors, and another seven people went missing, presumed drowned.

Malta’s prime minister, Robert Abela, is now under police investigation for the incident but remains defiant: “My conscience is clear because we have done everything in our power to protect our people and all those who live in this country,” he said, explaining that Malta’s ports were closed during the coronavirus pandemic. “In a health emergency, this country is not a safe port for migrants.”

To many people, this logic – we must look after our own – will seem unassailable, despite the costs. Malta is not the only country to shut off help to vulnerable migrants during the pandemic: Italy has also closed its ports, while the UK declines to evacuate refugee children with relatives in Britain from unsanitary Greek camps, and the US has quietly suspended its entire asylum system. Earlier this month, nearly 400 Rohingya refugees were found starving on a boat near Malaysia, which had reportedly cited the pandemic as a reason not to take them in.

Temporary limits on movement – within countries and cities, as well as internationally – are regarded by most public health experts as an essential part of the fight against the coronavirus. But the overriding message from leading scientists has been that this needs to be based on a system of testing and contact tracing that tracks the spread of the virus, rather than blanket assumptions about foreigners and other outsiders. If clampdowns on national borders are offered as a substitute for more meaningful forms of protection then everybody loses.

In recent years, as rightwing populism has become a defining political force in many parts of the world, the demand for tougher border control has come to stand in for a range of wider anxieties about identity, culture and economic security. The political theorist Wendy Brown links this to decades of neoliberal policies that have allowed finance-driven global capitalism to undermine wages, infrastructure and social security in wealthy countries; her book Walled States, Waning Sovereignty suggests that the politically potent image of the border wall has come to stand in for security that the state no longer provides.

Nowhere does this seem more apt today than the US. Universal healthcare and comprehensive unemployment support is anathema to much of the political elite; what they have instead is a president who grandstands about flight bans and protecting Americans from being “replaced” in their jobs by immigrants even as he actively undermines domestic social distancing policies and efforts to source vital medical equipment. But the impulse is present in Europe too: as the coronavirus arrived on the continent the first response of many rightwing populists was to attack refugee policy and the EU’s internal free movement rules. Some of these voices have, for the moment, been dimmed as many citizens prioritise the advice of scientific experts in a time of medical emergency.

If the border is a dominant symbol of national welfare, it is not the only one. In the UK, while a vocal minority on the right continues to play on this theme in order to attack domestic lockdown measures, it has been eclipsed by the call to rally around the NHS. There is no more powerful symbol of collective good in the British political lexicon; not even politicians who oppose the principle of socialised medicine dare say so openly. It sits at the heart of the government’s call to action: stay home, protect the NHS, save lives.

The solidarity expressed by millions of people at a moment of crisis is an amazing thing. As in other afflicted countries, the vast majority of the UK’s population have made huge, largely voluntary changes to their lives for collective benefit. But our desire for security can nonetheless be pushed in an exclusionary direction. “It’s the national health service, not the international health service,” wrote the health secretary Matt Hancock during last year’s general election campaign, promising to extend the health surcharge to non-resident EU citizens after Brexit.

Over the past decade, as the strength of the NHS has been depleted by austerity economics, along with other public services, the right has pushed the claim that foreigners are an unacceptable drain on the state, accompanied by a host of bureaucratic measures – charges, restrictions, surveillance, punishment – to police their activities even as the rest of society benefits from their labour. It is no small irony that as Britain expresses a newfound gratitude to the immigrants that help keep the NHS and other key services running, the Home Office is fighting to maintain many of its notorious hostile environment policies.

Once the pandemic subsides, and we are left to deal with the social and economic upheaval in its wake, nationalist demands for wealthy countries to turn inwards are likely to intensify. These may well start with demands to exclude outsiders but they are likely to turn on “undeserving” citizens too. Events in the Mediterranean may seem distant from many everyday concerns right now, but the way our governments treat people in need is the defining question of our time. If you want to see what happens when death and suffering are swept under the carpet and rendered acceptable by political euphemism and omission, then the frontiers of the rich world are a useful place to start. This is a planetary crisis, not a national one, and it is vital that we do not allow our respect for human life to end at the border.