check out our:
(Odysseus:) 'You dogs, you never thought I would any more come back from the land of Troy, and because of that you despoiled my household, and forcibly took my serving women to sleep beside you, and sought to win my wife while I was still alive, fearing neither the immortal gods who hold the wide heaven, nor any resentment sprung from men to be yours in the future. Now upon you all the terms of destruction are fastened.' […] [A]ll that you have now, and what you could add from elsewhere, even so, I would not stay my hands from the slaughter, until I had taken revenge for all the suitors' transgression. Now the choice has been set before you, either to fight me or run, if any of you can escape death and its spirits. But I think not one man will escape from sheer destruction.' (22.35-41, 62-67)
Here's your classic "if-then" causality: if you despoil a man's house, rape his servants, and come on to his wife, then you will be slaughtered. But is that the way justice works? Should work?
(Odysseus:) 'O son of Polytherses, lover of mockery, never speak loud and all at random in your recklessness. Rather leave all speech to the gods, since they are far stronger than you are. Here is your guest gift, in exchange for that hoof you formerly gave to godlike Odysseus, as he went about through the palace.' (22.287-291)
As the herdsman Polytherses kills nasty suitor Ktesippos, he makes sure the guy knows exactly why this is happening: it's "in exchange" for the time he threw the hoof at Odysseus. It's another example of cause-and-effect justice.
(Odysseus:) 'Keep your joy in your heart, old dame; stop, do not raise up the cry. It is not piety to glory so over slain men. These were destroyed by the doom of the gods and their own hard actions […].' (22.411-413)
You have to draw the line somewhere. It's just to mercilessly slaughter the suitors, but it's not just to gloat about it. The fact that it's just is actually what makes gloating wrong.