Why is Iago still alive at the end of Othello by Shakespeare?
We may view Iago as the puppeteer that has been pulling the strings of the ill-fated characters in Othello. From this point of view, it would not be meet to kill him before the puppet show has come to an end. Moreover, it would be totally alien to Iago's nature to take his own life, as it would be inconsistent with the civilized Venetian society, at this point represented by Gratiano, to have him killed without due process.
While the play does not provide a rough-and-ready answer to your question, it does allow for speculation. In a perfect world, Iago's death would prove that such villainy as his is measured and punished in accordance with his own standards. In other words, he would have a taste of his own medicine.
However, the world that Shakespeare depicts in this play is far from perfect. Chaos penetrates the developed European organization (Venice) as well as the feelings and actions of insiders and outsiders. Iago stands for many passions, but is also an instrument of chaos. That he is alive at the end of the play may well mean that the balance between crime and punishment should not be expected as a matter of course. No one knows exactly how Iago contrived his crimes except him, and as he "sentences himself to eternal silence" (Henry L. Warnken, "Iago As a Projection of Othello"), it will be difficult if not impossible to sentence him to death.
Thus we could surmise that Shakespeare's message in this respect is that justice is not always served.
It certainly would have tied things up more neatly if Iago had indeed met his demise at the end of Othello. Some measure of justice is achieved, as Iago is arrested and Lodovico says to "enforce" the "censure of this hellish villain," including "torture." It is difficult to know why Shakespeare left Iago alive. By making it clear that he will be tortured, he may have meant for the audience to perceive that Iago's fate would be worse than death. When Iago says to "Demand me nothing...From this time forth I never will speak word," Gratiano replys forebodingly that "Torments will ope your lips." Or he may have meant to further problematize the notion of justice after the death of the virtuous Desdemona.