The main theme presented in Poe's "The Cask of Amontillado" is revenge. The protagonist of the story, Montresor, opens the story telling of his dreams of revenge on Fortunato for the past fifty years. One can tell from this, that Montresor is certainly a little off based upon a fifty year grudge.
Montresor has the murder of Fortunato planned down to the most intimate details. He plans for the "abduction" to take place during carnival; this is a time where all are able to put on "masks" and not face typical scrutiny. This is very ironic given Montresor is masking his insanity with a different mask.
The behavior of Montrseor is the most telling regarding his insanity. Readers are never told what Fortunato did to bring on the revenge deemed so necessary by Montresor. This alone speaks to his insanity. What could be so bad that would merit death? Unfortunately, one never finds out. The fact that Montresor's revenge lies in an act omitted, one could assume that the thought of revenge alone, over fifty years, is what led Montersor to his insanity.
In the end, Montresor bricks Fortunato up in the catacombs of his families' property. Montresor, after his revenge has been enacted, he joins in Fortunato's screaming. It seems that his insanity has reached its breaking point.
The theme of revenge reflects Montresor's insanity given the period of time which he has struggled with the "injuries" Fortunato has placed upon him. Knowing that it took fifty years for Montresor to enact this revenge, one can only assume that it has eaten him up for the entire time as well. Montresor had no other choice but to "go" insane.