I'm assuming this idea comes along with some note that such prisoners are legally considered objects rather than living things, so none of those annoying medical ethics laws come into play. If that's not the case, this would end up just being a really stupid form of life in prison rather than some fantastical boon to medical testing. Most places have laws about how and when you can test medical products on humans, and that usually comes after lots and lots of testing in other ways to make sure it's probably safe. Without some "these entities don't count as people or living things anymore" clause in there, they would basically just supplement or replace standard clinical trials for medication, which is not exactly some huge pressing issue that we need bodies for. I'm going to assume that you're talking about other kinds of medical testing, like trying highly experimental medications or surgical techniques on them, and seeing how various harmful substances actually affect the human body. Y'know, the fucked up horror movie kind of medical testing.
Am I okay with people convicted for execution-worthy crimes being forced into that? Absolutely not. This is in fact worse than the death penalty. I'm totally in favor with the death penalty, but not this nonsense. Even in places where the death penalty exists, there's usually some kind of rule against torture and the like. In the United States Constitution, specifically the Eighth Amendment, the exact phrasing of the rule is "Excessive bail shall not be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted." Mandatory medical experimentation is both cruel and unusual by any reasonable definition.
Those sorts of anti-torture laws are damned good ones, and I support them completely. If you've decided someone is incapable of redemption, then you should kill them and be done with it. There is a huge leap between deciding that someone should be killed and that someone should be horribly tortured before eventually being killed. However, giving them a choice could be acceptable. Offer them the choice of execution or medical testing, with the caveat that at any time they may opt for the execution if they so choose, and that would be fine. Inflicting it as a mandatory punishment is, as you said, a gross violation of human rights and pretty much morally bankrupt. No thanks.