Right, sorry but I can't be bothered to read through 230 answers to this post, but it's made me angry that the question has even been asked.
I am a solicitor, though admittedly not a criminal defence solicitor. I do however know a vast number of defence solicitors who are good people and yet have defended people accused of, amongst other offences, murder, child abuse and rape.
First, if a defence solicitor KNOWS that a defendant has committed a crime (e.g. if they admit guilt), they advise the defendent to plead guilty. Should they refuse to do so, the solicitor is unable to continue to defend them and must inform the judge of such (in a tactful manner). Failure to do so constitutes serious misconduct.
Secondly, where a defendant has pleaded guilty, the solicitor's role is the to ensure that a fair sentence is given. Pleas in mitigation are heard, and defence solicitors usually set out the reasons why the lowest possible sentence should be given. On the other side, the prosecution sets out the reasons why the offender should be handed the most harsh sentence possible. The judge weighs the evidence and decides on the punishment. There are almost always partial defences or personal issues which may have an impact. Our legal system allows for this because it is FAIR to both parties.
Thirdly, where a defence solicitor is required to defebnde their client (e.g. on a not guilty plea), this is absolutely necessary to uphold the human right which ALL of us should enjoy - the right to a fair trial. If someone pleads not guilty it is not for you, the Daily Mail, the alleged victim's family or anyone else to decide whether they are in fact lying - that is for a judge or a jury to decide. In the UK we use an adversarial system in our court rooms, allowing both sides the chance to speak and both sides the chance to challenge each other's evidence. The aim here is to ensure that all facts are determined and all circumstances and word-against-word issues are hashed out, allowing the jury/judge to balance the evidence.
Fourthly, many of you appear to be suggesting that all victims tell the whole truth all of the time, or that all alleged victims are in fact just that. The harsh reality is that there are a huge number of false allegations made each and every day and, even where allegations are true, they are often exaggerated. If nothing else, a fair trial is just that - FAIR for BOTH parties. I have personally sat in on a rape trial where the poor man had been falsely accused. You'd have thought, from the press coverage and the fact that the alleged victim cried all the way through her examination and cross examination behind a requested screen, that she was telling the truth. Luckily, the defendent had a fantastic defence barrister who proved beyond reasonable doubt that she was lying in just three questions. She later admitted that she had just regretted the incident and had lied. This is not an uncommon occurence.
Finally, in order to prove guilt, it must be proven "beyond all reasonable doubt" in a fair trial. How can reasonable doubt be removed for any intelligent person without hearing both sides of a story and all evidence available? Just because you feel particularly strongly about some cases (e.g. child abuse or a brutal murder which has been proven beyond reasonable doubt) does not mean that the legal system is wrong.
Might I suggest that those of you who think defence solicitors "shouldn't be able to sleep at night" consider how you would feel if you were falsely accused of a crime?