If a prosecutor thinks the defendant is not guilty, he might decline to prosecute. Defense attorneys don't have the option of declining to defend a guilty man -- well, that's not strictly true, an individual defense attorney can, but sooner or later somebody has to agree to defend.
You hear people saying that they could never be a defense attorney because they could never defend a guilty person. Speaking theoretically (I am not a lawyer) my belief in the principle of due process means that, if I were a lawyer, I should be able to defend even someone I knew without a doubt was guilty of the most horrible crimes. Still, you always wonder, if you were a defense lawyer and you did find yourself in that situation, could you really give it your best efforts? Would the abstract principle that "everyone deserves a fair trial" be enough, especially in the face of the concrete: this scummy, guilty defendant right here? And deep down there was this question: I know defense attorneys are necessary to guard the rights of the innocent, but does that really excuse them from all moral culpability when defending a known-to-be-guilty criminal?
That's why I was glad to read the very first comment on this thread at the Volokh Conspiracy, who provided a concrete reason for a defense attorney to put his best efforts forward at defending even the known-to-be-guilty defendant.
When I was doing criminal defense work (as a PD), I thought of myself as an Inspector General for the criminal justice system. It was my job to make certain that the police and the prosecutors did their job, and did it properly.
My focus was on the police and prosecutor. My client's actual guilt or innocence was not relevant to whether the police had probable cause, got a needed warrant, gave a required warning, or whether the prosecutor laid the proper foundation for a question, introduced evidence on every element of the offense, engaged in improper final argument, etc.
Client's used to criticize me because I never asked them if they were innocent. I didn't ask because they got the same vigorous (but honest) defense whatever the answer.