"And they stoned him with stones, him alone" (Joshua 7:25) — "and they burned them with fire," Scripture speaks of his sons and his daughters, for so it had been said to him from the mouth of the Almighty: "and he that is taken with the devoted thing shall be burned with fire, he and all that he has" (Joshua 7:15). If so, why does Scripture say "and they stoned him"? It comes to teach you that Achan confessed that he had stolen on the Sabbath, and so he was stoned for desecrating the Sabbath and burned for trespassing against the devoted ban.
Stoned for the Sabbath and Burned for the Devoted Ban
Yalkut Shimoni on Nach 18:13
וירגמו אותו אבן הוא לבדו (יהושע ז, כה), וישרפו אותם באש בבניו ובבנותיו הכתוב מדבר שכן נאמר לו מפי הגבורה והיה הנלכד בחרם ישרף באש אותו ואת כל אשר לו א"כ מה ת"ל וירגמו אותו אתא ללמדך שהודה עכן שבשבת גנב ונסקל על חלול שבת ונשרף על שמעל בחרם: