A question/comment I hear from time to time is this: How can you defend someone you know is guilty?
There are a some variations. My favorite is: What if you were defending someone you knew was guilty and you won? How would you feel about that? Answer: I'd feel GREAT!!! It means I did a great job.
Now here's how I really respond: Do you ask prosecutors how they can prosecute someone they know is innocent? Or how they can look the other way when they know the cops are doing bad things like beating up innocent people?
This is usually met with a sense of disbelief. How could I think that prosecutors and cops would do such things? Because it happens. Most cops are good cops, but there are a few bad ones. And prosecutors, almost universally, look the other way and even back up the cop when pressured. That's reality.
Now here's the reality of criminal defense lawyers defending someone we know is guilty. We try to get them the best deal we can. Winning a case for a defendant who is actually guilty is extremely rare. Our job is to minimize the consequences for our clients. We work with the prosecutors and everyone else involved to see what kind of deal we can get. If we can find any kind of weakness in the prosecution's case, we use that to negotiate a better deal. In general, guilty clients are just looking for a deal. They do not want to go to trial because they know they're likely to lose and they don't want to face the longer sentence.
A far greater concern about criminal defense lawyers is that one might sell out his client, or not defend the client vigorously enough. If you were the one facing criminal charges, you'd want your lawyer to fight for you. We have an adversary system of justice, and it works pretty well (with some failings).