Why are the Old Testament stories like Amalek recorded for us?
Old Testament accounts such as Amalek are recorded for our learning, not primarily for doctrine, but for practical experience. They illustrate how the flesh wars against the new nature after a person enters right relationship with God and partakes of living water. Amalek pictures the flesh warring against the spiritual.
Les explains that Amalek was a grandson of Esau, and the Amalekites became the continuous enemy of the nation of Israel. At this point they fought Israel because they saw the abundance of water God provided when Israel smote the rock; it became warfare over the water. Les applies this by noting that many such things, as Paul says, are written for our learning, not so much for doctrine, but for practical experience. Just as a person comes into a right relationship with God, is born again, becomes a child of God, and partakes of living water, the old flesh begins the war against the new nature. The Amalekites picture the flesh warring against the spiritual. This setting is before grace, while God is still dealing with the nation of Israel and shortly will be under law.