Where sin abounds with Achan at Jericho, grace abounds all the more at the defeat of Ai. And that abundant grace "spoils" the Israelites.
When God brings Israel back to Canaan to take possession of it, after being gone for 400 years in Egypt and 40 years in the wilderness, the first city they come to is Jericho. There God promises that he will give them victory: "See, I have given Jericho into your hand" (Joshua 6:2).
But there is one caveat to their destruction of Jericho:
The city and all that is within it shall be devoted to the Lord for destruction. . . Keep yourselves from the things devoted to destruction. (6:17-18)
When the day arrives and the wall falls down, the Lord is faithful to give Israel victory over Jericho, just as he promised. But the people of Israel "break faith in regard to the devoted things" (7:1). A man named Achan directly disobeys the command of the Lord and, seeing its beauty and value, takes some of the spoil from Jericho and buries it under his tent.
Initially, nobody else knows. It isn't until Israel fails at taking the next city, Ai, that they realize something must be wrong. At first, Joshua thinks God isn't carrying through with his promises—"Alas, O Lord God, why have you brought this people over the Jordan at all, to give us into the hands of the Amorites, to destroy us?" (7:7)
But God, in his mercy, points Joshua to the real cause: "Israel has sinned . . . they have taken some of the devoted things; they have stolen and lied and put them among their own belongings" (7:11). Then he issues a prescription for how they can repent and find favor with him again (7:13-15), which they immediately carry out (7:16-26).
Now, you would think that Israel's bad record of greed at Jericho would make the Lord more reserved in what he gives them the next time. In our natural minds, we think the best way to prevent disobedience is to take away opportunities for it (which, coincidentally, are also opportunities for obedience). But God knows a better way.
After their repentance, God leads Israel back up to Ai with a promise just like the one he gave at Jericho, "See, I have given into your hand the king of Ai, and his people, his city, and his land" (8:1). But there's a major difference this time: no caveat. And not only no caveat. There is a positive command to do precisely what had been restricted at Jericho: "Only its spoil and its livestock you shall take as plunder for yourselves" (8:2).
So what is God's response to Israel's abuse of grace and their subsequent repentance? More grace.
Like the father of the prodigal son, God the Father of Israel does not withhold his gifts when his son repents. He doesn't treat him like one of his hired servants. He slaughters the fatted calf.
In Joshua 8, God increases his generosity to a repentant Israel, giving them the thing they were really seeking when they resorted to disobedience in the first place. He gives them the spoil.
Take heart, then, fellow sinner. Where you have sought fulfillment outside of the will of God, repent. knowing that he who poured out such abundant grace on Israel will also pour it out on you who have become his child through Jesus Christ.