At Jericho, the victory was God's alone. It was precipitated by His Ark, the symbol of His earthly throne, and resulted from the miraculous collapse of the city's fortifications. As aresult the spoils were prohibited. At the Ai, the groundwork for the undertaking that resulted in success was prepared by the twin components of Yehoshua's meticulous planning and the people's spirited struggle. While God in the end provided the critical catalyst for the victory, it was a triumph that belonged to all of Israel. Therefore, the spoils are also given over to them to stress the significance of THEIR initiative and to highlight THEIR involvement. 

Courtesy of the Virtual Beit Midrash, Yeshivat Har Etzion