In this chapter, Israel is defeated at Ai because of the sin of Achan.
There's a couple different things going on in this chapter. After the destruction of Jericho, we can see that the metaphorical door into this region has been opened. Having taken out the premier city, Joshua is now looking to wipe out some of the smaller towns and villages such as Ai, and this really shows both the scale of the Israelite invasion and their earnestness in carrying out the genocide they have been ordered to perform. So we can see right away that this war is going to definitely be expanding very quickly.
Secondly, even though only 36 Israelites died attacking Ai, we can see that Joshua's immediate concern is that "all the inhabitants of the land will hear of it" and be encouraged, such that they attack Israel and destroy it. This is just another example of how significant morale could be in ancient warfare, as I have discussed several times before. The defeat in Ai, against a numerically inferior foe, is more of a psychological blow than anything else.
Third, and this is perhaps the most notable feature of this chapter, is how the sin of one man results in harm to the whole community. I mean, Achan wasn't even one of the 36 people who died attacking Ai. In a similar way, when Achan is put to death for his sin, his children and animals are also stoned to death, which shows that just as the original sin resulted in harm to the community, so does the punishment of the responsible man result in harm to the children under his protection. This is also a principle I have talked about before, because a very similar thing happened to the families of Korah, Dathan and Abiram in Num 16 after they sinned against the LORD. As a principle it also shows up in the story of Noah, when Noah's whole family is saved because he was regarded as a righteous man (this was in Gen 6 and 7). So it happens with both sins causing problems to those around us and righteousness causing good things to those around us.
In this chapter, we see the principle being applied on both a small scale, with a man's family, and on a large scale, with that same man affecting the outcome of battles fought by the nation as a whole.
Fourth, this chapter shows us the significance of consecration. Crossing over the Jordan river was a metaphor for consecration, and the mass circumcision at Gilgal was a much more direct adherence to the covenant. Joshua also asked the people to spend three days consecrating themselves before they entered the promised land, and now that they are here the sin of Achan essentially violated their consecration. As it turns out, it is the Israelites' consecration to the LORD that is the source of their victories in battle. Without it, the LORD will not assist them, and without the LORD they will not be victorious in taking the promised land. Just as they depended on manna in the desert, they depend on the LORD for victory in the land of promise.
On a minor note, "give glory to God" or "give glory to the LORD" is a phrase that basically means, "tell the truth" or "be honest". We see this phrase used a second time in the NT in John 9:24. We also see divination by lot in this chapter. I can't remember if this happened in the Pentateuch, but there are a couple times in the OT where divination by lot is used to find someone who is specified by the LORD.
Having "purged the evil from amongst you" (cf. Deut 13:5, 17:7, etc), the Israelites are now ready to begin their invasion anew.