Amalekites, by Turretinfan.
Here is the critical passage:
There is absolutely no question that the Lord commanded the slaughter of the Amalekites. Moreover, the explicitly stated reason for this slaughter is that they attacked Israel during the Exodus. That does not mean that God did not have other reasons.
And he goes on to say:
But Victor does not need to speculate. God gives a reason. The reason is retaliation for prior treachery. Of course, the sucklings were not a part of that treachery, but the crime was performed by the nation and they are in a federal relationship with respect to the nation. Absent God’s mercy, the judgment on the nation extends even to those who had no personal part in it. Indeed, given the lapse of time between the Exodus and Saul, it seems unlikely that there were any alive in Amalek who had been in any personal way involved in the attack on Israel. So, it is not only the sucklings who are receiving judgment from God for the sins of their fathers, but also the adults of Amalek as well.
One of Victor’s problems is that he is attempting to impose an external moral framework on the situation, instead of trying to extract a moral framework from the situation. What God does is right. That should be the premise. Examples like the commanded destruction of the children of Amalek teach us about the heritability of guilt for sin.
What people find shocking in the Amalekite case is that descendants are being given a kind of "national death penalty" for actions their remote ancestors did which the individuals involved had nothing to do with. We are inclined to suppose that children are innocent, and as such can't be blamed for actions their ancestors performed. We moderns are committed to the doctrine of individual responsibility, and from that standpoint the ban on the Amalekites does indeed seem unjust. If we can swallow the idea that someone can deserve the death penalty for the actions of an ancestor, then the Amalekite ban ceases to be a problem.
However, the Doctrine of Individual Responsibility has an important biblical foundation, in Ezekiel 18 (NIV):
The One Who Sins Will Die
1The word of the Lord came to me: 2“What do you people mean by quoting this proverb about the land of Israel:
“ ‘The parents eat sour grapes,
and the children’s teeth are set on edge’?
3“As surely as I live, declares the Sovereign Lord, you will no longer quote this proverb in Israel. 4For everyone belongs to me, the parent as well as the child—both alike belong to me. The one who sins is the one who will die.
5“Suppose there is a righteous man
who does what is just and right.
6He does not eat at the mountain shrines
or look to the idols of Israel.
He does not defile his neighbor’s wife
or have sexual relations with a woman during her period.
7He does not oppress anyone,
but returns what he took in pledge for a loan.
He does not commit robbery
but gives his food to the hungry
and provides clothing for the naked.
8He does not lend to them at interest
or take a profit from them.
He withholds his hand from doing wrong
and judges fairly between two parties.
9He follows my decrees
and faithfully keeps my laws.
That man is righteous;
he will surely live,
declares the Sovereign Lord.
10“Suppose he has a violent son, who sheds blood or does any of these other thingsa 11(though the father has done none of them):
“He eats at the mountain shrines.
He defiles his neighbor’s wife.
12He oppresses the poor and needy.
He commits robbery.
He does not return what he took in pledge.
He looks to the idols.
He does detestable things.
13He lends at interest and takes a profit.
Will such a man live? He will not! Because he has done all these detestable things, he is to be put to death; his blood will be on his own head.
14“But suppose this son has a son who sees all the sins his father commits, and though he sees them, he does not do such things:
15“He does not eat at the mountain shrines
or look to the idols of Israel.
He does not defile his neighbor’s wife.
16He does not oppress anyone
or require a pledge for a loan.
He does not commit robbery
but gives his food to the hungry
and provides clothing for the naked.
17He withholds his hand from mistreating the poor
and takes no interest or profit from them.
He keeps my laws and follows my decrees.
He will not die for his father’s sin; he will surely live. 18But his father will die for his own sin, because he practiced extortion, robbed his brother and did what was wrong among his people.
19“Yet you ask, ‘Why does the son not share the guilt of his father?’ Since the son has done what is just and right and has been careful to keep all my decrees, he will surely live. 20The one who sins is the one who will die. The child will not share the guilt of the parent, nor will the parent share the guilt of the child. The righteousness of the righteous will be credited to them, and the wickedness of the wicked will be charged against them.
21“But if a wicked person turns away from all the sins they have committed and keeps all my decrees and does what is just and right, that person will surely live; they will not die. 22None of the offenses they have committed will be remembered against them. Because of the righteous things they have done, they will live.23Do I take any pleasure in the death of the wicked? declares the Sovereign Lord. Rather, am I not pleased when they turn from their ways and live?
24“But if a righteous person turns from their righteousness and commits sin and does the same detestable things the wicked person does, will they live? None of the righteous things that person has done will be remembered. Because of the unfaithfulness they are guilty of and because of the sins they have committed, they will die.
25“Yet you say, ‘The way of the Lord is not just.’ Hear, you Israelites: Is my way unjust? Is it not your ways that are unjust? 26If a righteous person turns from their righteousness and commits sin, they will die for it; because of the sin they have committed they will die. 27But if a wicked person turns away from the wickedness they have committed and does what is just and right, they will save their life. 28Because they consider all the offenses they have committed and turn away from them, that person will surely live; they will not die. 29Yet the Israelites say, ‘The way of the Lord is not just.’ Are my ways unjust, people of Israel? Is it not your ways that are unjust?
30“Therefore, you Israelites, I will judge each of you according to your own ways, declares the SovereignLord. Repent! Turn away from all your offenses; then sin will not be your downfall. 31Rid yourselves of all the offenses you have committed, and get a new heart and a new spirit. Why will you die, people of Israel? 32For I take no pleasure in the death of anyone, declares the Sovereign Lord. Repent and live!
So I am inclined to think that saying "Just follow the Bible and give up the Doctrine of Individual Responsibility" is a bit of an oversimplified answer.