Lawyers are governed by a Code of Ethics. It is important to spend some time reading these and understanding them. Many situations on their face may not even seem wrong. For example, can you represent a woman in a divorce proceeding if you previously represented her husband's employer in a healthcare benefits dispute? That seems like a far-fetched example, but what if, in representing the employer, you somehow gained access to information that you can use to the wife's advantage in the divorce case?
I'm not a lawyer, but have worked with them. The most important thing as a lawyer is that you are representing your client - trying to get the best possible outcome for him/her, without violating the code of ethics. Every person deserves the best possible outcome on the punishment phase, even a convicted murderer. That is at the heart of our legal system.
Lawyers are considered "officers of the court" and are expected to act accordingly. They are not supposed to knowingly allow their client to lie under oath. Read up on the topic of "testifying in the narrative." It's interesting!