The story is simple. Achan of the tribe of Judah has, against express orders, reserved plunder for himself. God is angry at all Israel. Spies report that the city of Ai is weak, and that only a fraction of the men will be required to take it. Doing so, the invading force is routed, with 36 dead. As Joshua inquires into the matter, God lays out a lengthy catalogue of complaints: Israel has broken the covenant, lied, sinned, and stolen. Early the next morning, indicating zeal, Joshua has the people consecrate themselves. Through some kind of divination, Joshua determines that a Judean, Achan, is guilty. Matthew Henry also notes that Joshua deals with Achan respectfully, tenderly, calling him "my son" (
http://www.blueletterbible.org/tmp_dir/c/1093417075-8494.html). Achan confesses to stealing 5 pounds of silver, 1 1/4 pounds of gold, and a beautiful Babylonian robe. Israel stones him (and his children and livestock) to death in what becomes known as the Valley of Trouble (Achan). His property, including the precious metals, are burned.
There are many ways to view this story. Louis Ginzberg's "The Legends of the Jews" proposes that Achan was a hardened sinner, who had frequently misappropriated holy things (
http://www.sacred-texts.com/jud/loj/loj402.htm). Yair Zakobitz, writing for The Jewish Agency for Israel says that it makes clear that faith in God is supreme (
http://www.jafi.org.il/education/torani/nehardeah/shlach.html). Battlefield prowess and especially espionage are no substitute for faith. Some commentators frame this as God bringing down collective punishment on the nation for the sin of one man, although it is difficult to think of any other instance in the Bible when this occurs. God is always seeking to preserve the righteous, not to destroy them.
These analyses miss some important points. First of all, God is angry at more than one man. He is angry at a transgression of the whole people, yet is satisfied when a scapegoat is killed. He is angry at lying, which it is not evident that Achan has done. It's not clear that God has much to do directly with the defeat at Ai. Even when the city is taken, it requires the full army and a clever plot. Rather, Joshua seems to have reneged on performing his role as general, accepting without consulting God a battle plan drawn up by spies. Finally, God seems genuinely contemptuous of Joshua's prayer. In the mouth of Moses, such an abject prayer brought divine reconciliation, but God tells Joshua, "Stand up! What are you doing down on your face?"
A coherent interpretation of the story would be that hubris has afflicted the whole people as a result of the easy victory at Jericho. Many have broken the covenant by imagining that they and not God are responsible. Some have lied, perhaps by boasting. Others have sinned in other ways. Perhaps they failed to cut down the Asherah poles. One has committed the act that God finds unforgivable, largely holding back precious metals from the collective treasury, and this one is sacrificed.
But the sin is spread more widely than Achan and it manifests itself in several militarily disastrous ways: Joshua fails to consult the Lord in planning a battle; he allows a small force to be sent up when there is no good reason not to send the full forces; he apparently decides to take his rest rather than leading the troops; and when things go badly, the Israelites-- lacking confidence in God-- break ranks and run. This is how pride is manifested, and we can see it operating even today, if we will open our eyes.