"So Joshua sent messengers, and they ran to the tent, and there it was, hidden in his tent, with the silver underneath. They took the things from the tent, brought them to Joshua and all the Israelites and spread them out before the Lord. Then Joshua, together with all Israel, took Achan son of Zerah, the silver, the robe, the gold bar, his sons and daughters, his cattle, donkeys and sheep, his tent and all that he had, to the Valley of Achor. Joshua said, 'Why have you brought this trouble on us? The Lord will bring trouble on you today.' Then all Israel stoned him, and after they had stoned the rest, they burned them. Over Achan they heaped up a large pile of rocks, which remains to this day. Then the Lord turned from his fierce anger. Therefore that place has been called the Valley of Achor ever since." NIV translation
All of Israel was used as God's instrument of judgment. As the head of his family, Achan had involved the rest in his sin and so they were all punished.