“A nd the matter was good in my eyes and I took from you 12 men one man for each tribe.” (Devarim 1:23)

Rashi says that the spies were selected from the finest of each shevet.

The Ramban (Bamidbar 13:4) says that the Torah lists the spies’ names in order of greatness; Yehoshua was fifth on the list. From here we see the incredible level of each spy. However once the request was made to send spies Hashem said “I will give them a way to err.” (Rashi Bamidar 13:2)

As Chazal say (Yoma 38b): “One who wants to become impure it’s opened for him.”