At that point, he had a responsibility to face his client with the facts and try to get him the best deal possible. That is what council is.
What we have now is a win at any cost system, not a justice system. I also think it's the responsibility of the lawyer to ASK the client if he's guilty. He can still represent him in court, but there should be no perversion of the law and truth just to get someone off. If the lawyer legitimately thinks the client is innocent, and then he turns out to be guilty, that's quite another matter. Lawyers have access to all the evidence, what they need is a moral compass that will stop them from abetting a criminal in order to get a fee or advance their career.