Famous for their refusal to follow the "voice of the masses" upon the return from the spies' mission to scout out the Land of Israel, Yehoshua and Kaleiv stand out as paradigms of correct behavior even when it requires standing alone, ignoring the lure of conformism. Such immense spiritual power was implanted within the Jewish nation by its original founder, Avram HaIvri, whose appellation Ivri is explained by Breishis Rabba (42) as connoting the fact that the whole world was on one 'eiver (side) and he was on the other in his belief system and actions. Nonetheless, the fact that the other spies did not draw from this well of fortitude leads us to question how these two giants succeeded where others failed.
In the opening passages of Parshat Sh'lach, after the identification by name of the "leaders of Israel" who were sent as scouts to Eretz Yisrael, Moshe calls the former Hoshei'a bin Nun, his loyal student, by the name of Yehoshua. Rashi, quoting from the Midrash, interprets the passage to mean that Moshe prayed (or alternatively, by changing his name included such an implicit prayer (see R'eim and other commentaries on Rashi)) that "Kah yoshia'cha mei'atzat ham'rag'lim" - "May Hashem save you from the (evil) counsel of the spies". Moshe's prayer assured that at least one spy would remain loyal to Hashem and give B'nai Yisrael an opportunity to hear his voice of truth and possibly avert the coming disaster which Moshe Rabbeinu prophetically feared. Moshe offers no such name change or prayer for Kaleiv ben Y'funeh.
Later, after the disastrous, slanderous report given by the m'rag'lim and the subsequent Divine decree that the entire generation would perish in the desert, Hashem promises that:
"v'avdi Kaleiv, eikev hay'sa ruach acheres 'imo vay'malei acharay, v'havi'osiv 'el ha'aretz 'asher ba shama v'zar'o yorishena" - "and my servant Kaleiv, because he possessed a "ru'ach acheres" (a different spirit) and loyally followed me, I will bring him to the land to which he came and his descendants will inherit it" (14:24). On a simple plane, the "ru'ach acheret" refers to the fact that he followed a different path from the majority (Ibn Ezra; see also Rashi). It is noteworthy that Yehoshua is not mentioned here as also being excluded from the decree on the generation of the desert and is only mentioned later in verse 30. Also interesting is the use of the title "avdi", "my servant", a title most famously used to describe Moshe at the end of last week's parsha (12:8).
Ohr HaChayim in his comments on this passuk offers a penetrating insight into the source of Kaleiv's success in not being influenced by the other spies' evil plan and contrasts his method with that of Yehoshua. Kaleiv, worried that he indeed might be tempted to join the spies' evil intentions, breaks away from the rest of the group and visits the M'arat HaMachpeila in Chevron to beseech Hashem in the merit of our Avot that he should be able to withstand this temptation. With the merit of this prayer, and his enormous will-power, he is able to remain loyal to Hashem and attempts to convince the Jewish Nation of their ability to enter the Land with Hashem's assistance even in light of the immense might of the resident Canaanites. Unlike Yehoshua, who even before he entered into the Land was already blessed by Moshe, the greatest tzadik, and thus was given spiritual immunity against the negative effects of the plot of the other m'rag'lim, Kaleiv had to resist on his own. He had a "ru'ach acheres" in him connoting the Yeitzer HaRa, the Evil Inclination, another voice encouraging him to join the rest, but he successfully resists. This enormous victory earns him the title of "avdi", a loyal servant, who, like Moshe Rabbeinu, utilizes his free will to do that which was correct in the eyes of his Master. Perhaps we can add that it is for a similar reason that Kaleiv offered tefilot at the graves of the 'Avot. They, led by the example Avraham Avinu (as mentioned earlier), were able to withstand the lure of the society around them and remain faithful to HaKadosh Baruch Hu.
What emerges then are two models for success at combating sin: that of Yehoshua, through original, sometimes supernatural, spiritual immunity, and that of Kaleiv, through will-power and the conquering of the Yeitzer HaRa. Many commentaries have noted a similar duality in the progenitors of each of these noble personalities. Yoseif is the "tzadik from birth". The apple of his father's eye, the special recipient of the Torah of Ya'akov 'Avinu, a born leader, Yoseif successfully resists temptation in Mitzrayim and becomes almost another "Av" of Klal Yisrael by serving as the pivotal leader preparing the Jewish Nation for the long exile of Mitzrayim (see Gemara Sanhedrin 19b, "b'nei Ya'akov v'Yoseif sela"). Yoseif is of course the direct ancestor of Yehoshua through his son Efrayim. By contrast, Yehuda is the paradigm of the "ba'al t'shuva", the one who fails at first by encouraging the brothers to sell Yoseif rather than returning him to his father but then courageously corrects his error through his willingness to sacrifice his own freedom to allow Binyamin to return to his father. He also admits his fatherhood of Peretz and Zerach from his daughter-in-law Tamar thus saving her from death rather than saving his prestige by allowing Tamar to be executed and not admitting this fact. Ya'akov praises him at the end of his life with the words "miteref b'ni 'alisa" - "from the [plot of the] destruction of my son (Yoseif) you have risen" and over which you have done a complete repentance (VaYechi 49:9). Yehuda is the direct ancestor of Kaleiv, the one who similarly battles his yeitzer. [A similar comparison can be made with the spiritual successes and failures of King David, the model of a ba'al teshuva (see Avoda Zara 5a), a descendant of Yehuda, and King Sha'ul, a descendant of Binyamin and a born tzadik (see Yoma 22b).]
Ultimately, only Kaleiv, who through his own efforts succeeded without the original siyata dishmaya Yehoshua had been granted, is crowned with the title "avdi" at this point in history. Yehoshua, although also righteous, does not receive this title yet since his ability to remain loyal to Hashem was not solely through his own efforts. Some commentaries to Seifer Yehoshua note that Yehoshua eventually does receive this title at the end of his life. Seifer Yehoshua begins with Hashem telling Yehoshua who is known as "m'shareis Moshe", "the attendant of Moshe": "Moshe 'Avdi Meis", "Moshe, my servant died" and ends with "VaYamas Yehoshua 'Eved Hashem", "and Yehoshua, the servant of G-d, died". According to the above approach, it was only after Yehoshua encountered his own challenges through his years of leadership - concerning which he did not receive a direct Divine blessing of success - and overcomes them that he is crowned with this title. (See also Michtav Eliyahu (Vol. 1, p. 111 ff.) for his famous presentation of the concept of the N'kudas HaB'chira, the point of Free Choice which is different for all people. Also see HaKesav v'Hakabbala to VaEtchanan 6:5.)
What we see from Ohr HaChayim's approach is that it is precisely through those trials in life that force us to utilize talents that are not necessarily inborn or thoroughly implanted through our upbringing that we achieve our mission in our lives. There are aspects in our Divine Service with respect to which Hashem grants us Yehoshua-like immunity by implanting within us innate tendencies toward the good, planting us within families and environments that foster such an attitude or arranges for our receiving the blessing of a tzaddik through which Hashem will bestow certain abilities upon us. But there are other aspects concerning which G-d demands of us Kaleiv-like fortitude to overcome our Yeitzer HaRa for sin. Although we daven daily for Divine intervention "lo lidei nisayon", beseeching G-d to avert many trials and temptations from us so that we do not fail much as Moshe davened for Yehoshua, we remain fully cognizant of the fact that we must be presented with at least some trials "tailor-made" uniquely for us through which we can achieve our destiny in becoming "avdei Hashem".