The spoil of Jericho was the firstfruits of the conquest of Canaan and therefore belonged totally to God. The spoils of all other cities belonged to the people of Israel. (Joshua 8:2) When God has rewarded you for your service, don't wait to give back what's his. Don't hold onto your firstfruits and tithes, but give them away quickly. (Joshua 8:5)

Deception and ambush in war isn't wrong. Normal laws against killing, stealing, and enslaving are suspended in war. Maybe "redirected" is a better word, because the rights to life, liberty, and property of God's enemies that have been suspended, not God's laws. (Joshua 8)