Inmates housed in a gymnasium due to overcrowding at the California Institution for Men state prison in Chino, California, 2011.Lucy Nicholson / Reuters

There were no condoms in prison, only plastic bread bags and occasional rubber gloves, in Tela La’Raine Love’s experience. As a transgender woman locked among men in Louisiana’s Orleans Parish Prison, she recalled in an essay last year, “In order to preserve some safety and dignity, I always chose a man before one tried to impose his will on me.”

It was that dynamic—sex “out of fear and necessity”—that left her with HIV.

Some countries do make condoms available to prisoners, while others cite security issues, or blanket prohibitions of sex. Only last year, California became the second state to require that condoms be available to all prisoners. Even in places where condoms are available, guards sometimes limit distribution as a form of control.

In the medical journal The Lancet this week, researchers at Johns Hopkins cite this as one factor in the spread of infectious diseases in prisons. The researchers argue that this spread amounts to a human-rights abuse and a violation of international law—a cruel and inhuman failure to ensure humane prison conditions.

The penal system remains a source of diseases that spread among prisoners at rates far exceeding those in the communities from which they came. Of more than 10 million incarcerated people in the U.S. alone, 4 percent have HIV, 15 percent have hepatitis C, and 3 percent have active tuberculosis. These diseases are part of our criminal justice system, then, metered out and sanctioned implicitly by the state.

The penal system is also a primary reason that these diseases can’t be eliminated globally, and the problem goes well beyond condoms, according to Chris Beyrer, the Desmond Tutu Professor of Public Health and Human Rights at Hopkins, who edited the Lancet research series. He spoke with me by phone from South Africa, where he is co-chairing the International AIDS Conference in Durban. He sounded distraught over the fact that HIV infections stopped declining years ago in the United States, and are now stable around 45,000 every year.

In his findings, the spread of disease within prisons is a small factor compared to the effects of releasing inmates into the community with no access to treatment. Even in prison systems where people have antiviral medications, the primary problem is really the lack of care once they go back into the community. When a person with HIV, for example, has an interruption in their treatment regimen, the virus comes roaring back. Those people are infectious again, and often highly so. That creates a serious risk for their sexual partners, and anyone with whom they may share needles.

The scale of the problem is due to the fact that so many people are incarcerated in the first place, which Beyrer traces to the war on drugs.

“It’s abundantly clear that incarceration is a failure in terms of reducing substance abuse, but it also has these consequences for HIV, hepatitis, and TB,” he said. “We've been promoting this language around an ‘AIDS-free generation,’ but, in fact, failing ourselves.”

A practical approach to all of this is a new idea, but one that is supposed to be guaranteed by a recent international agreement. In 1955, the UN adopted a set of guidelines for the rights of prisoners, known as the Standard Minimum Rules for the Treatment of Prisoners. While they represented a major advance at the time, they were still minimal, lacking an understanding of how infections spread, and of substance abuse, and mental illness among prisoners, among myriad other roads that lead to prison and out of it.

It took 60 years for the world to espouse more comprehensive standards, but the General Assembly finally agreed on an update to the rules in December of 2015. Now known as the Mandela Rules—for the man who was effectively given tuberculosis as part of his sentence—they start from the basic premise that prisons must protect human rights and dignity. People need adequate food, sanitation, ventilation, and to be protected from violence.

Basic as that may sound, former UN Special Rapporteur on Torture Nigel Rodley called this a “real deontological reorientation of the philosophy of penal institutional management”—a move toward understanding prisons as places of preparation for reintegration into society. With that came a focus on health, which may be the most striking advance in the rules: They guarantee a full range of diagnostic, prevention, and treatment services, including mental health and drug-dependency treatment. They say that prisoners “should enjoy the same standards of health care that are available in the community, and should have access to necessary health-care services” and be organized in a way that ensures continuity of treatment and care after release.

And this is yet, in many places, not happening. Cutting off basic treatments as soon as a person walks out of their cell is a failure to protect the public health and, really, a failure to provide care at all—a violation of the Mandela Rules. And it perpetuates inequality in individual communities. As black men are disproportionately incarcerated, infectious disease spreads disproportionally in black communities. Among transgender women of color in the U.S., the rate of HIV infection is 27 percent, inextricably linked to the incarceration rate, and some 35 percent of transgender prisoners in the U.S. report sexual victimization while incarcerated.

“The unfortunate reality is that when heroin and other injected drug use was largely confined to minority, inner city populations, all the approaches were about law, zero tolerance, mandatory minimum sentencing,” said Beyrer. “Now that heroin is a problem of rural and suburban white communities, suddenly we're talking about compassion and managing overdose and drug treatment, and less about policing.”

For decades, many Republicans insisted, for example, on maintaining the federal ban on needle and syringe exchange—despite clear evidence that needle and syringe exchange is a safe, cheap, and effective way to prevent HIV and hepatitis. That decision was reversed in December by none other than Mitch McConnell, in the wake of HIV and hepatitis outbreaks in Indiana and Kentucky.

So an approach to infectious diseases must involve reform in criminal law, toward justice systems that do not treat substance abuse with imprisonment. For people who do make it to prison, care of infectious diseases is not care if it does not continue upon leaving. These policies will come from an emphasis on the penal system as a tool of rehabilitation, and an institution where human rights demand protection.

When Tela La’Raine Love was abused in prison, she recalls going to a guard for help. He rebuked her: “You’re a man. Fight them if they’re bothering you.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.