Horrific by our modern standards, true ... but we live in a different culture.
In Hebrew culture, the Amalekites were not just an enemy people, they were a people that were completely dedicated to the destruction of the Hebrews. They had repeatedly attacked the weak, slaughtered women and children, stole what they could, and destroyed what they could not steal. They are evil incarnate, so G_d orders the Amalekites destroyed utterly. Today, of course, we would call the assessment of an entire people based solely on their ethnicity as "evil incarnate" as racism ... but back then, the concept did not exist.
To read a text from another culture without some understanding of that culture is a sure-fire recipe for failure to understand the text.