When I was in college, people used to ask me, "How could you defend somebody you know is guilty?" I used to dodge the question by saying, "Well, it'd be my job." But I don't think that fully--or satisfactorily--explains it.
Our legal system works by assigning roles. And it works best when the players assume those roles zealously. The judge, for example, has to be zealous about the law, even when bad facts make it tough. The jury, likewise, has to be zealous about figuring out what happened.
Do you know who doesn't get to decide the facts? The lawyers. If you, as defense counsel, decide you're not going to represent Joe because you think he's guilty, then you're usurping the jury's job and short-circuiting the system.
And short circuits cause fires.
Just a thought.