This passage is read twice a year, on Shabbat parashat Ki Tetzei and on the Shabbat prior to Purim, when we recall the deeds of the wicked Haman, a latter-day Amalek.
The command does not, however, require us to kill Amalek, or Haman, or any similarly-minded individual. What it is after is the eradication of the memory, the spirit, the ethos, of the wicked.
If Amalek ceases to be Amalek and Haman ceases to be Haman, because they have fully and finally given up their wickedness, they become different people and their t’shuvah has to be respected.
This appears to be the lesson taught by a wise wife, Beruriah, to her husband, Rabbi Meir.
When Rabbi Meir was troubled by a band of lawless men, he wanted to pray to God to destroy the criminals. Beruriah quoted to him the final verse of Psalm 104, Yittammu chata’im min ha’aretz ur’sha’im od enam – “Let sinners cease out of the earth, and let the wicked be no more” – but she slightly changed the vowels, so that the verse read, “Let sins cease out of the earth, and the wicked will be no more”.
It is not the sinners whom we should pray to be eradicated, she said, but the sinfulness. When the sinners are not sinful any longer, the wicked will be no more (B’rachot 10a).