"And Joshua took Achan son of Zerah, and the silver, and the mantle, and the wedge of gold, and his sons and his daughters" (Joshua 7:24). The Exilarch said to Rav Huna: if he sinned, what did his sons and daughters do [to deserve this]? He said to him: by your reasoning, if he sinned, what did all Israel do, as it is written, "and all Israel with him"? Rather, they were brought to make them witness [the punishment]; here too, to make them witness. "And they burned them with fire, and they stoned them with stones" (Joshua 7:25) — two [forms of execution]? Ravina said: the one fit for burning, to burning; the one fit for stoning, to stoning.
Why Achan's Children Were Brought to the Valley of Achor
Yalkut Shimoni on Nach 18:9
ויקח יהושע את עכן בן זרח ואת הכסף ואת האדרת ואת לשון הזהב ואת בניו ואת בנותיו (יהושע ז, כד). א"ל ריש גלותא לרב הונא אם הוא חטא בניו ובנותיו מה חטאו, א"ל ולטעמך אם הוא חטא כל ישראל מה חטאו דכתיב וכל ישראל עמו אלא להראותם הכא נמי להראותם. וישרפו אותם ויסקלו אותם באבנים, תרתי, אמר רבינא הראוי לשרפה לשרפה הראוי לסקילה לסקילה: