This is Rabbi Steinsaltz's response:
In the Bible, we have two almost opposite reactions to the fall of an enemy.
On the one hand, we have the famous verse that says, “Do not rejoice when your enemy falls, and let not your heart be glad when he stumbles.” (Proverbs 24, 17)
On the other hand, we have, among many others, the verse, “When the wicked perish, there is joy.” (Ibid., 11, 10)
In fact, there is no contradiction between those two verses.
The first one refers to a situation in which there is animosity or a quarrel between two people.
In such a case, a person may have an enemy, but his downfall shouldn’t be any reason for rejoicing.
Whatever the quarrel – commercial, political or any other kind – the enemy is just a person in opposition.
Such people may cause discomfort to the other side, but essentially, both parties are equal to each other.
Therefore, one should not rejoice when one’s enemy has fallen.
The other verse does not deal with personal or national disagreement, but with an objective fact: there indeed are wicked people in the world.
And when the wicked are destroyed, others should express their approval and their joy that some vicious object or person has disappeared from the world.
Osama bin Laden created for himself a very clear position as one of the wicked, and therefore the world should be happy when at least one element of evil is no longer functioning.
–Rabbi Adin Steinsaltz
From the website of The Aleph Society, May 5, 2011