It's possible that Poe intended this tale's principal theme to be a moral one, that of the wrongness of seeking revenge. If so, however, we would have to account for the fact that the avenger in this case is not subjected to any retribution against him for the crime of murder, and a gruesome murder at that. This "madman," unlike those in the "Tell-tale Heart" and "The Black Cat," gets away with it. He's not even shown suffering guilt, fifty years later, though it's possible that despite his neutral, unperturbed tone in narrating the story, he's unburdening his soul by making a cathartic revelation. Given the length of time that has passed since he killed Fortunato, Montresor must now be a very old man, especially by the standards of Poe's time and more so earlier, when the story evidently takes place.
Poe's stories, unlike those of his contemporary Hawthorne with which he had much in common, generally don't present themes involving an explicit moral point or a "message." We might conclude that Poe's intent is purely to shock the reader by creating an atmosphere of violence and terror. But one can say that this purpose, and the atmosphere that Poe creates here in order to facilitate it, are in themselves the "theme." The action of a Poe tale is a metaphor of the helplessness of humankind.
In his works it's as if we are stuck in a dream, a nightmare that we cannot emerge from, and in which we can't uncover the real meaning, the sense behind the seeming meaninglessness of what we observe happening. Why does Montresor hate Fortunato to the extent that he would wall him up alive in the catacombs? No answer. All we are given is the generalized statement about the "thousand injuries," and the darkness of these cellars through which Montresor leads his victim. What Poe deliberately leaves unsaid is an analogue to the symbolism of a dream, in which more often than not the dreamer can't fathom the mystery of the absurd things taking place.
The tale's setting in Italy is significant. English and American writers of the period were obsessed with Italy as an exotic, magical place where the Western world's mythic identity was rooted. What could be more fascinating and horrible than a grotesque murder happening in a land which, with its warmth and perceived moral freedom, is so different from the anglophone world?
This exoticism and mystery are at the heart of Poe's subject, as they are in Hawthorne's depiction of a fabled Italy in "Rappaccini's Daughter." In Poe it's as though the setting in itself overrides any conventional theme that might be read in the story. Just as in his poetry, Poe seems to value sheer sound, the dream music of words, over an explicit meaning or purpose. In "The Cask of Amontillado," the outward elements of irrationality and mayhem override any explicit ideas that might nevertheless be expressed in the story.