Joshua 6:24

And they burnt the city with fire, and all that was therein: only the silver, and the gold, and the vessels of brass and of iron, they put into the treasury of the house of the LORD.

The burning of the city with all that was in it, and the putting of the silver and gold and vessels of brass and iron into the treasury of the house of the Lord, belongs to the capture of Jericho as the first step in the conquest of Canaan, in the march from Gilgal to overthrow the city.
Joshua sought assurance of divine guidance, and Christ as Captain of the host of the Lord appeared to him with assurance that Jericho with its king and mighty men was given into his hand, along with instruction for taking the city.

The destruction was God's judgment: the city was burned, while Rahab and her household were spared because she had shown favor to the Lord's messengers, and the silver and gold and vessels of brass and iron were put into the treasury of the house of the Lord for the service of the tabernacle.
The city and its contents were devoted to God as the first-fruits of the land, to teach Israel that the victory belonged to the Lord and that the people were not to seek wealth or self-exaltation in conquering Canaan.

The victory came by God's direction rather than the usual wisdom and skill of human armies.
God directed the battle and arranged the work of heavenly and human agents, and no human hand touched the city walls, so no person had grounds for taking credit.
Success depends on God's help working with human effort, his commands must be obeyed regardless of the world's opinion, and the glory belongs to God alone though he works through human agents.