In Othello, Shakespeare illustrates that he opposes racism. He shows his lack of racism by making his black protagonist an admirable person of great courage and character. Othello is a traditional tragic hero, moral and honorable but with a tragic flaw. He is a successful military leader and a man of virtue who other men respect, regardless of his race. He is able to earn the love of a beautiful and virtuous young woman. His flaw is that his insecurity over his age and race causes him to doubt being truly lovable to Desdemona.
Further, Shakespeare shows his condemnation of racism by putting the racist sentiments in the play in the mouth of the twisted and evil Iago. Iago's racist obsession with sex between a black man and white woman is shown to be part of his deeply damaged personality. He tries, for example, to incite Desdemona's father, Brabantio, against Othello by implying he kidnapped her and is now raping her. In Act I, scene 1, Iago arouses Brabantio with:
Even now, now, very now, an old black ram
Is tupping your white ewe. Arise, arise!
Awake the snorting citizens with the bell,
Or else the devil will make a grandsire of you.
Iago thinks of sex between Iago and Desdemona as animalistic and characterizes Othello as a "devil" because of his race, but the better characters in the play don't share his sentiments. Desdemona, for example, loves Othello for the person he is: his race doesn't matter to her at all.
By making the hero of his play a black man while making the villain of it a twisted racist, Shakespeare makes clear his anti-racist viewpoint.