I don't really want to discuss the merits or otherwise of the death penalty[1], but to those who talk about whether prosecutors should prosecute those that they believe are innocent, there's also the flip-side of whether defenders should defend those that they believe are guilty.
Everyone is entitled to having someone defend them (if they don't go down the route of rejecting any defence or actually representing themselves, of course) but I've heard various prominent lawyers say in interviews that they would primarily have to act upon what the client told them (even if it's "it wasn't me, it was aliens, who framed me with a doppelganger", however difficult it would make their case), but if they really could not defend them for some reason (maybe even being told "Yeah, it was me, but you'll get me off, right?" for the principled guys who tend to answer these kinds of questions truthfully) that they'd ask that the client obtain some other legal representation. Is this right or wrong? What if every potential representative is convinced that you're guilty (and not willing to go against their conscience). Disenfranchisement results.
Of course, there should be legal backstops "this person will never get a fair trial" and such (which could even be invoked by those that believe their guilt, because it could still invoke measures that would defend the public even while the individual from the mob-mentality), and (quite likely) there's always the possibility of an Evil Perry Mason who can might even get genocide converted down to no more a parking fine[3] in the inverse situation.
Of course, I have very little experience (and essentially none, beyond the fictional representations) of the US legal system. I'm under the impression that when there is enough political/social will to try someone there'll be someone asked to prosecute. I've no idea how much "I can't prosecute, I think they're innocent!" wiggle-room there is for passing the buck. DAs, etc, tend to get seen to take on the politically-expedient jobs (for good or ill) from what I see, although whether that's because they're after making more of a name for themselves (often they are, in fictional accounts with corrupt DAs) or because "nobody else dares/wants to and it needs doing" (again, a common fictional play, this time generally the reformer/anti-corruption DAs going 'against the system-gone-wrong').
But all of that is just words of bad speculation, influenced by fairy tales. In an ideal world there probably needs to be both those who would defend the 'clearly' indefensible and those who would prosecute the 'obviously' innocent, because when the process is gone through it may be found to be not so clear-cut. Of course, not only do we have that kind of people, but we have the kinds who will do so at any personal moral cost. And now the line blurs even more, for good or ill. And the effects of rogue/misguided juries (or judicial panels of whatever kind) are another issue.
You may also consider this to be nothing at all to do with the thread, in which case you are free to ignore it.
[1] We don't have it here, and a number of people are calling for it to be available; you have it there and a number[2] of people are calling for it to be abolished. The phrase "hard cases make bad laws" applies in both cases, to some extent.
[2] A different number/proportion, but neither numbers matter, outside of actually going out there and voting for/against something (either directly, or for representatives who support their POV)... There'll always be dissenting opinions, because these issues are complex!
[3] That's hyperbole; I don't actually think that's necessarily a desirable situation.