Why did GOD wanted King Saul to wipe out Amalekites (1 Sam. 15:3)?

Some say it was the Old Testament versus New Testament problem, like the God of the Old Testament was a different God than the New Testament. But isn’t it contradicting?