This quotation by the narrator, Montresor, as he takes revenge on Fortunato (a name ironic in and of itself, given how he will meet his most unfortunate end) essentially means that if he (Montresor) were to get caught and punished for what he is about to do to Fortunato, then Fortunato is essentially getting away with the wrong or wrong he committed against Montresor, even though he will be dead. For this reason, Montresor leads Fortunato, who is inebriated, into the catacombs, chains him to a wall and bricks him in while Fortunato slowly becomes aware of what is happening. In this way, Montresor has ensured that no one will ever find Fortunato, and his revenge will stand without punishment to himself. This is one of several places where Montresor's ramblings and whinings about Fortunato show him to be not exactly playing with the full deck.
This phrase is crucial to the plot. It would not be a major problem for Montresor to murder Fortunato, but his biggest problem is to do so without getting caught. When he generalizes that "a wrong is unredressed when retribution overtakes its redresser" he is simply saying that his revenge will not be a success unless he can obtain it without suffering any consequences himself. He is not only thinking of being apprehended by the police and sentenced to death; he is also thinking that Fortunato's relatives or friends might take their own revenge if he managed to escape legal punishment. That is what he means by "retribution." So Montresor has made careful plans for many years to commit a murder for which he will not even be suspected. In order to avoid suspicion, he has pretended to be a very good friend of his intended victim. He has become so accustomed to calling him his friend and speaking of his as his friend, that he does so throughout his narrative. The fact that he keeps referring to him as his friend and his good friend and his poor friend is not intended to be ironic but to show the reader how completely Montresor has conditioned himself to treat the man he intends to murder as his best friend. In this way nobody will ever suspect him of being responsible for Fortunato's mysterious disappearance.