It is a standard military tactic to find out as much as possible about your enemy before engaging them in battle. Moses sent twelve spies to look over the land of Canaan (Numbers 13:1 – 14:45), each one of them being a chief/leader of one of the tribes of Israel (Numbers 13:2–16). He also sent out spies before the people of Israel engaged in battle with one of the Amorite kings (Numbers 21:32). Sending the spies was not an act of unbelief by Joshua. Rather it testifies to human responsibility and common sense.1
1 And Joshua the son of Nun sent two men secretly from Shittim as spies, saying, “Go, view the land, especially Jericho.” And they went and came into the house of a prostitute whose name was Rahab and lodged there.