Oedipus blinds himself for more than one reason. What are these reasons? And, why does he not, like Jocasta, commit suicide?
Oedipus's tragic flaw is his hubris or pride. This pride metaphorically blinds him to what is actually going on around him: he understands himself as a great and good king. It is inconceivable to him that he could be the cause of the plague in Thebes which has been attributed to the unsolved murder of King Laius. When he curses the murderer and promises to root him out, he has no idea he is cursing and condemning himself.
When he discovers that he has, in fact, killed his father, Laius, and married his mother, the news causes him great anguish and that need to relieve this emotion and punish himself leads him to blind himself. It also fulfills prophecy. Blinding himself shows his new humility as well: he acknowledges he is a limited human being, subject to fate. His blindness is yet another irony in the play: when he had physical eyesight he couldn't perceive his circumstances the way he now can when blind. Through his physical blindness, he acknowledges he no longer thinks of himself as invincible.
In addition to the reasons outlined by wannam, we can say that there is a symbolic reason for Oedipus blinding himself. Oedipus has until this point been metaphorically blind, dealing intemperately with others, heaping scorn on the blind prophet Tiresias, accusing Creon of trying to bring him down, and so on. In a word,he has been guilty of hubris. But now when faced with the shattering revelation of his own crimes (committed albeit unwittingly), he at last sees the truth, the horror of which is insupportable. Now he is no longer blind in a figurative sense, but he inflicts a self-punishment that renders him physically blind. In this way he becomes more akin to Tiresias, the wise, blind seer who warned him and who made a prediction:
Blind who now has eyes, beggar who now is rich,
he will grope his way toward a foreign soil,
a stick tapping before him step by step.
This refers to the dethroning of Oedipus and his looming exile. He himself is the pollutant of the land, which he sought to eradicate; so now he must leave.
Oedipus's self-blinding, then, is symbolic as well as literal. It is a kind of poetic justice, and it also fulfills Tiresias' earlier prediction. Also, we might add that he does not commit suicide like Jocasta because he has more mettle. What he has learned is unendurable, yet he does find the strength to endure it. In fact, in Oedipus at Colonus, the sequel to this play, he regains something of his old fire and authority even in exile; he becomes a kind of oracle himself, and in the end is called home by the gods.