When your enemy falls, do not rejoice (Proverbs 24:17).
The Torah explicitly forbids taking revenge, or when doing a favor to someone who had denied your request, to say, "You see, I am not like you. I am doing you a favor even though you refused me when I needed your help."
Solomon goes one step further. He states that passive revenge is also wrong. Even if your enemies have come to grief without your contributing to it in any way, you should not enjoy their downfall.
Solomon's father David was the victim of a ruthless rebellion led by another son, Avshalom, who drove him from the land. As David was in the process of quelling the rebellion, Avshalom was killed. Although the son had been his father's mortal enemy, David grieved bitterly for him, going so far as to say, "Would that I had died instead of you" (II Samuel 19:1). He was of course, feeling the paternal love which can prevail over all other emotions.
While it is not realistic to expect anyone to grieve over an enemy's misfortune as a father might grieve over the misfortune of a defiant son, we can have enough compassion for other human beings to at least not rejoice in their downfall, even if they were our enemies.