In Joshua 7, the Jewish nation suffers military defeat, and it is blamed on the sin of an individual, Achan. Some commentators explain that collective responsibility is a natural function of the Jewish nation. For example:
"All Israel are bound together as one body, such
that each individual will relate to the community as a limb of the body relates
to the body. Just as illness or destruction of one limb causes illness or a
defect in the entire body, so, too, when Achan took from the spoils it was
considered as though the entire nation had trespassed..."
(Commentary of Malbim to Yehoshua 7:1)
"It is possible, without any impropriety, for chance
to cause children to suffer punishment for parental sin; this will not involve
impropriety at all. For example: If a person were to sin against the government
and they would punish him justly, such that he would lose his wealth, this
wwould cause punishment for his children, who would be paupers and would not
inherit anything that they had been due to receive from their father's assets."
(Commentary of Ralbag to Yehoshua 7:1)
Have a great day,
Mordechai