There are several reasons to do this. Phoenix and JuiceBox (trade mark limited) got it.Inmates appear to purposely infect themselves with virus - CNN Video
Inmates at a California correctional facility drank from the same cup with the purpose of infecting one another, resulting in 21 cases of coronavirus, according to the Los Angeles County Sheriff's Department.edition.cnn.com
If you get sick you get taken to the prison hospital, and in severe cases you might get taken to a public or private hospital. This gets you out of the cell and into an area with less security so there is more chance of escaping.
If prisoners are being threatened in their cells or in public areas, going to a hospital gets you away from the threats for a short time and that relieves the stress you are under.
Hospitals are much more comfortable than a prison cell with a bunk mate you don't like. One person per bed if you get what I mean.
Hospitals have television and real food, instead of no TV and powdered egg and canned meat.
Then there are lifers, prisoners sentenced to life imprisonment. They have no chance of release and will die in a cell. Many give up hope and try suicide, this is just another way out. Catch a virus and maybe you get lucky and die in hospital instead of a cell at the age of 90. Alternatively, escape from hospital and continue doing bad things.
At the very least, the chance of getting or spreading covid19 provides a break from day to day activities in a prison. At worse, the prisoners contaminate all the guards and the prisoners escape from hospital and go on a crime spree.