Montresor wants to commit a perfect crime, and he succeeds in doing so. He not only wants to avoid getting punished for Fortunato's murder, but he wants to make sure that he isn't even suspected of having anything to do with Fortunato's strange disappearance. "Impunity" literally means freedom from punishment. Montresor can only enjoy such freedom if he doesn't have to worry about coming under suspicion at some future time. At the end of the tale he says:
Against the new masonry I re-erected the old rampart of bones. For the half of a century no mortal has disturbed them.
This means that his wall has not been discovered in fifty years, and hence the skeleton of Fortunato has not been discovered either. This seems to prove that Montresor committed his crime with "impunity," and perhaps it is only now, after fifty years, that he feels completely safe from punishment.
Montresor's desire for impunity is largely responsible for his problem, and his problem is what drives the story from beginning to end. He wants to get Fortunato down into the catacombs, which offer the best place to hide the body. Getting rid of a body is almost always the problem in a perfect-crime story. He can tell Fortunato he has a cask of Amontillado down there--but why should Fortunato volunteer to accompany him to his palazzo immediately? And how can Montresor conduct Fortunato to his palazzo without being seen by many witnesses as the last person to be with Fortunato before his disappearance?
Montresor lures Fortunato to his death by telling him he got a bargain on the wine. This is what interests Fortunato. But he doesn't have to sample Montresor's wine at all. He naturally assumes that a ship must have just arrived from Barcelona with a whole cargo of Amontillado. He would have no trouble finding the ship (if it existed). But Montresor forestalls that possibility by saying that he is on his way to Luchesi. Fortunato doesn't want Luchesi to hear about a cargo of Amontillado for sale at a bargain price. This forces him to go with Montresor.
And how does Montresor manage to get Fortunato to his palazzo without being recognized as his companion? Edgar Allan Poe shows his genius here. He makes Fortunato so conspicuous in a harlequin jester's costume complete with a cap with ringing bells that Montresor, in his black cloak and black mask, is like a shadow. Everybody will remember seeing Fortunato on the night of his disappearance--but nobody will remember seeing anybody with him.
In order to assure himself of "impunity," Montresor also does everything possible to make everybody, including Fortunato, believe that these two men are the best of friends. Throughout the story Montresor addresses Fortunato as "My friend" and speaks of him as "My friend," "My good friend," and "My poor friend." No doubt he always refers to Fortunato as "My good friend" whenever he is talking about him to other people. In fact, Montresor has so conditioned himself to thinking of Fortunato as his very good friend that he cannot help referring to him as "My friend" even while he is leading him to his death. After Fortunato disappears, there is bound to be a widespread and long-lasting inquiry; but it will never occur to anybody that Montresor could have had anything to do with Fortunato's disappearance because he is such a devoted friend. Montresor will continue to make inquiries about Fortunato long after everybody else has stopped wondering about him. Montresor will have achieved perfect impunity.