I'm sure God had a good reason. Didn't the Amalekites refuse to let the Hebrews pass through their territory, and also attacked them at some point? If I remember correclty, they also practiced human sacrifice.
The Amalekites sacrificed their children to Molech, just like America aborts children in the name of sex without consequences.