Of course many of the criminals in New York jails are part of criminal gangs. Their choice is commit crimes or be killed by their gang. It is not just a matter of personal choice and morality.
But more to the point was the Mayor's act of mercy an act of true mercy. Was it even good for the criminals. The murder rate of prisoners in jail and prison is about the same as that of the general population. But the prisoners are not average members of the general population.
When the prisoners are on the outside they are massively more likely to murdered than the rest of the population. They are much safer in prison.
On the other hand the probability of a criminal in their twenties dying of COVID-19 is quite low. Even if the rate of infection is prison is very high, they might be far safer in prison than on the streets.
Furthermore, staying at home is not necessarily an option for the prisoners. They are frequently part of gangs and there is work to done, which often means crimes to be committed. This will put them in contact with others so they may well be infected.
In many cases they may live with older relatives, mothers and grandmothers, who are old enough to die from COVID-19. If they got COVID-19 in prison they are unlikely to endanger those relatives. They may be mostly around other young men who are likely to have a mild case that they may not even notice. Outside of prison they are likely to get COVID-19 and spread it to people who are a risk.
Many people are concerned with the high percentage of our population that is incarcerated. But for many gang members prison could be considered an act of mercy. The people we put in prison are far more likely than the general population to murder someone. They are also many times as likely to be a murder victim.