We sometimes play certain social roles in which it is morally appropriate to disregard certain otherwise weighty considerations and to give great weight to others than one could otherwise disregard.
Examples. A trustee should try to find the best possible investments for her ward without regard to how such investments of his funds would affect the value of her own portfolio. A judge or juror should set asides her likes and dislikes of certain kinds of people. A legislator should disregard the impact pending legislation would have on her son's business. The common idea here is that important social purposes are best promoted if the occupants of certain roles understand them in these ways.
The lawyer's role is somewhat unusual because it is fitted into an adversarial system. The idea behind such a system is that the socially best outcomes are achieved when some of the protagonists do not aim for them but for something quite different. To get the most exciting soccer match, we need players focused not on making the match as exciting as possible, but players focused on winning. To get just and fair outcomes in the courtroom, we need lawyers focused not on getting just and fair outcomes, but on getting their client to win. That's the theory.
It's immediately clear that, in an adversarial system, the role players' conduct must be constrained. Players and lawyers should want to win, but not by bribing the referee or judge, and not by poisoning their opposites. Still, within these constraints, players and lawyers may fight pretty hard and one-sidedly for their own side.
The lawyers' role morality raises interesting ethical issues when a lawyer's behavior hurts not the opposing side (which, ideally at least, has its own lawyer), but innocent third parties. Thus, a lawyer's best way to get her client off the hook may be to "destroy" an elderly witness or to suggest without a shred of evidence that a rape victim is a "loose woman." Lawyers like to think that their role morality permits or even mandates such conduct on their part. But I do not think it is plausible to hold that a lawyer may or should do in her client's behalf what it would be wrong for this client to do in his own behalf. If it would be wrong for a rapist to try to get a more lenient sentence by making wholly ungrounded suggestions about the "looseness" of his victim's "sexual morals", then it would be wrong for his lawyer to make such wholly ungrounded suggestions for the same purpose.