In "Oedipus Rex" Oedipus is a prime example of someone who thinks he's trying to do the right thing, but in actuality he is participating in an injustice.
When Oedipus arrives in Thebes, the city is facing plague, fires, and famines after the murder of their king, Laius. Oedipus, trying to help, has the taken the place of the king and married his wife, Jocasta. He has also sent Jocasta's brother, Creon, to Delphi to find out from the Oracle how to stop the town's trouble. Creon reports that the Oracle agrees that the gods are causing these punishments and want the Thebeians to drive the evil from their city that killed their king. Here is where Oedipus tries to help. He vows to find the king's killer and free the city of the evil. Unfortunately, Oedipus doesn't realize that he is the evil he is looking for. It's not until later when he is attacking Creon that he learns the truth. Oedipus believes that Creon is after his crown and thrown. He calls for his death but the chorus doesn't let him proceed without proof. Jocasta tries to calm her husband down be telling of the way her Laius died. As she tells the tale, Oedipus realizes the truth; he is in fact the murder he is looking for.
Oedipus was just trying to do the right thing. However, his intentions do not go the way they are planned and he ends up murdering his father and marrying his mother. Surly no one would plan that.