Suppose a defense lawyer strongly suspects (to the point that he would be willing to bet a large amount of money on it) that his client has committed the crime he charged with. Would it be right or wrong for him to encourage the jury to deliver a "not guilty" verdict?
At least in the USA, the premise of the criminal justice system is that the burden is on the state to establish guilt "beyond a reasonable doubt." And there are various reasons why we might want to stick to that standard. It's not a good thing when a guilty person goes free, but it's also not a good thing when the state has low standards for establishing guilt. And so the usual idea is that everyone is entitled to a vigorous defense. Even if the lawyer believes in his/her heart of hearts that the client is guilty, the question for the judge and jury is whether the state's arguments and evidence make the case.