In [II Samuel chapter 21](https://www.sefaria.org/II_Samuel.21?lang=bi), David orders the hanging of seven males from Saul's issue (at the request of the Gibeonites) for Saul's wiping out of Nob. When I read this chapter, I was confused.

We know from the Torah that sons cannot be put to death on account of their father's sins ([Deuteronomy 24:16](https://www.sefaria.org/Deuteronomy.24.16?lang=bi&aliyot=0); [Ezekiel 18:20](https://www.sefaria.org/Ezekiel.18.20?lang=bi)), so why were Saul's descendants killed for the sin Saul committed in wiping out Nob?

[Rashi says](https://www.sefaria.org/II_Samuel.21.7?lang=bi&p2=Rashi_on_II_Samuel.21.7.1&lang2=bi) that each descendant of Saul passed before the Ark of the Covenant, and whoever the Ark clutched was selected to be killed. Does this mean that this act was approved by Heaven?