Well, for one thing, it was originally
here. Basically, though, it's that
divine nature is being equated with human nature. God's actions are being analyzed as if they were the actions of an Israeli military commander in, say, the 12th century B.C. (which I believe is around the correct era for the Israelite/Amalekite incident). This is the context in which the relative morality of God's actions is being placed, and I have to say that I think this is inevitable whenever literal biblical inerrancy is followed through to its logical conclusion.
Of course this is what you're going to get when reading a book written by human beings and not by God, and that's the fundamental fallacy of literal biblical inerrancy.