The (קרן אורה (סוטה לד (thanks Chaim B) answers both questions as follows:
Moshe did not know that the Meraglim would sin. Rather he knew that the mission would be a serious challenge and the that yetzer hara would try very hard to entrap them and cause them to sin. Therefore he davened that they should succeed.
If so why did Moshe only daven for Yehoshua? He answers based on the Arizal as follows. Each Nasi represented a shevet and therefore the neshama of the progenitor of the shevet was with the Nasi on the trip. Moshe thought that would protect them and therefore he did not see the need to daven for them. However, Yehoshua was from Efraim and therefore had no progenitor to protect him (I guess you can ask why didn't Efraim's neshama come?) as the pasuk puts Menashe and Yosef together so Yosef went with Gadi ben Susi from Menashe and not Yehoshua. Therefore Moshe davened specifically for Yehoshua so that he would have different protection.