It's a tricky balancing act, but let's start with this: most criminal lawyers are regularly dealing with clients who have broken the law (not all of them, but most), and so, in some sense, the client is "guilty." But guilty of what, exactly?
Take the case of the Toronto police officer who shot the boy Sammy Yatin in the streetcar. That officer was clearly guilty of firing his gun and killing the young man. But was he guilty of 2nd degree murder, manslaughter, or was it justifiable homicide in the performance of his professional duties and in accordance with his training? In that case, the nature of the accused's responsibility was what the jury had to determine, as the broad outline of the events that occurred was well known. It was by no means an open-and-shut "obvious" case - different very conscientious jurors could, and likely did, interpret the evidence differently and would reach a different verdict with respect to the officer's guilt. They ended up bringing down a verdict of guilty of attempted murder. That was probably a compromise, where different jurors felt that the officer was more (or less) culpable. Because the crime was less brutally heinous than ones like this, I don't think there was any outcry that a lawyer should not be defending him, but it illustrates one aspect of the question: the lawyer is not tasked with judging the degree or extent of the client's guilt, but with ensuring his right to a fair trial, including acting as a watchdog on evidence brought against him, putting forward any mitigating factors that may apply (the lawyer in this case, IIRC, made a pretty big deal about the type of training the officer had received and argued his response was consistent with it - whether that is justification is something the jury decides, but the lawyer's bringing the matter up is quite ethical).
Remember that, in sensational cases such as this (as well as in lesser ones), clients are not necessarily telling their lawyers the truth. If they say they have an alibi, the lawyer will research it and see if it can be honestly put forward. The lawyer will not, ethically, present evidence that he knows to be false (something Crowns, as well as defense counsel, have done in the past), He will call witnesses that support his client, whether these be character witnesses, witnesses that provide an alibi, or witnesses that call Crown evidence into question that he feels are credible and telling the truth. He can of course be wrong (as can the Crown about its witnesses), but the witnesses he calls, he calls in good faith that they are honest and will bring needed evidence to the table.
In really damning cases, the most the defense counsel can do may be to challenge some evidence, based on valid legal arguments, and raise doubts about the validity of some testimony. He will not try to argue that his client is "innocent." The client enters the court "innocent until proven guilty," although the general public has the opposite approach in most cases: if someone is charged with sensational crimes, the public normally considers them guilty until proven innocent.
Often the defense counsel will try to arrange a plea resolution agreement that he feels is fair to the client (given the facts and evidence he is aware of), and if the Crown agrees, this frequently takes place, but less often in cases like this, where as the saying goes, justice must be seen to be done. The Homolka "deal" is still fresh in many minds.
So in general (and I'm not a lawyer, but have many legal contacts) it is unethical for a defense lawyer, or a Crown either, to knowingly put forward false "facts" or arguments, but it is legitimate to emphasize areas where mitigating circumstances might apply, where circumstantial evidence is capable of more than one interpretation, where details are unknown, where the Crown's evidence may be questionable, and suggest that the totality of the evidence does not add up to proof beyond a reasonable doubt.
In some cases, the defense enters a counter-narrative, but if one does so, he is ethically obliged to consider it may be true. He doesn't have to be certain (nor does the Crown have to be certain of the guilt of the accused), but he can't put forth a wild tale the client told him just because the client told him. He's used to having clients who lie, after all. And criminal defense lawyers rarely ask their clients if they are "guilty." That is a matter for the jury to decide.
This essay may be of use, but with a caveat: it's referring to the US criminal justice system and not all the details are the same. For example, Canada does not have a "double jeopardy" guarantee. If a court acquits someone here, the Crown can appeal and try the person again in hopes of a conviction. That is not allowed in the USA, but a recent case here was of Guy Paul Morin, who was acquitted at his first trial, convicted on the second (massive screw-ups in that trial by multiple parties), and completely exonerated by DNA.
http://www.ethicsscoreboard.com/list/defense.html
In this case, I doubt any of the legal teams believe the accused had nothing to do with the death of Tim Bosma. But there is room for debate on whether they are equally guilty, whether it was "planned and deliberate," whether it was a robbery that went amiss, even whether the shooting was accidental (I don't buy it, but a possible scenario might be imagined). I think it will be hard for DM's lawyer to make a strong counter-argument, but they may be in possession of facts we don't know yet. MS's team may be able to put forward an argument that while their client was a party to the offense, he neither planned nor executed the killing and therefore is guilty of a lesser degree of homicide than his co-accused. If one of the lawyers put such an argument forward, he would (ethically) need to think it is a possible scenario. He does not need to "know" it is true -- how could he know, anyway? - but he cannot put forth an argument that he knows is untrue.