In 2 Samuel 21:1-14, we see that Saul committed an awful crime, and this caused famine in Israel. David then goes to Gibeonites and asked to make amends. They agree to the death of seven of Saul's descendants. Why were two of Saul's sons and five of Saul's grandsons killed for a crime they didn't commit? Is there something I'm missing?
The old testament is the kingdom of God in carnal illustrations. The barley harvest was the first harvest at the time of in gathering, which represents the first fruits of God who have renounced the flesh. Saul represents the flesh and his offspring likewise. David represents the spiritual. 7 is the number of completion. The flesh must be completely put to death and only the barley harvest through the grace of God apprehend that for which Christ apprehended them.
These people were punished for their fathers' crimes. For many of us living in the 21st century in the West, this offends our sense of justice. But if you look back throughout history, generally the crimes of the son have always affected the father, and the crimes of the father have always affected the son.
Later in the Old Testament, in Ezekiel Chapter 18, the Lord decreed specifically that Children should not be punished for their parents sins, this is actually the context where we get a somewhat famous verse, Ezekiel 18:20: "The soul who sins shall die."
I'll quote some for context.
The word of the Lord came to me again, saying, “What do you mean when you use this proverb concerning the land of Israel, saying: ‘The fathers have eaten sour grapes, And the children’s teeth are set on edge’?
The idea is that fathers do an action, and the children are the ones who experience the consequence.
Gods response is in verse 3-4:
“As I live,” says the Lord God, “you shall no longer use this proverb in Israel.
“Behold, all souls are Mine;
The soul of the father
As well as the soul of the son is Mine;
The soul who sins shall die.
So here God affirms that children should not be punished for their parents' crimes if they are indeed innocent, which is more in line with our modern view of justice for sure.
So to answer your question, they were killed for their father/grandfathers' crimes. But I sort of got the impression you were also asking, "What does the Bible say about children being punished for their fathers crimes?" So I added that aspect also.