I
"To walk in all His ways and to cleave to Him" (Devarim 11:22).
Is it possible to cleave to Hashem? Is He not a consuming fire (4:24)? Rather, cleave to the students of Torah and to the chachamim, and Hashem will consider it on your behalf as if you cleaved to Him (Rashi).
Is it possible for a person to walk behind the Shechina (13:5)? Is He not a consuming fire? Rather, follow his attributes of chessed, clothe the naked, visit the sick, consol the mourners (Sotah 14a).
Just as He is merciful, so should you be merciful (Shabbos 133b).
The progression of the passuk, as understood by Chazal, implies that character refinement, such as loving-kindness and mercy, must precede, and should result in, cleaving to talmedei chachamim. Why is this so?
II
The gemara in Pesachim (49b) recounts that R' Akiva said, "When I was an am haaretz, I said ‘Who would give me a talmid chacham and I would bite him like a donkey'". In other words, R' Akiva would be so angry at the talmid chacham as to want to harm him, and, as a result, would grit his teeth (Maharsha). Yet, when R' Akiva was a shepherd, Rachel saw that he was modest and lofty (ma'ali), and offered to marry him if he would go to a rav to study Torah (Kesuhbos 62b). How could one who was lofty wish to bite a talmid chacham?
R' Akiva did not hate talmdei chachamim. Rather, because he thought that they acted arrogantly and hatefully towards the unlearned amei haaretz he wished to bite them. But, to compound the original question, we know that R' Akiva was also a shomer mitzvos (Tosafos). So, how are we to understand the above?
Tosafos implicitly criticizes the Torah scholars of R' Akiva's time for improperly conveying the impression, even to a person as astute as the young Akiva, that they hated amei haaretz. Such an impression typically results in the unlearned, even those who are modest and refined individuals, harboring a hatred that they perceive is reciprocal.
III
One should learn Torah and serve Torah scholars. His dealings with briyos should be pleasant. What do briyos say about him? Fortunate are his father and teacher who taught him Torah. Woe unto briyos who do not learn Torah. This person who learned Torah, see how pleasant are his ways, how refined are his deeds (Yoma 86a).
A Torah scholar should make Hashem's name beloved to all briyos. As a result, Jews will come closer to Torah observance, and non-Jews will develop a greater respect for Torah and its scholars. In this way, Hashem's name will be sanctified, and the Jewish people earn the title "Yisroel, in whom I (i.e. Hashem) take glory" (Yeshayahu 49:3).
The Mishna in Avos (4:1) states, "Who is honored? He who honors others (briyos), as it is said, ‘For those who honor Me I will honor' (Shmuel I 2:30)". The proof text the mishna cites refers to honoring Hashem, not humans, so how does it prove that we must honor other people? The answer lies in the word "briyos". We must love briyos simply because they are creations of Hashem (Tosafos Yom Tov, Avos 1:12). Similarly, we honor humans because they all are created in Hashem's image (Breishis 9:6) and are, therefore, beloved (Avos 3:18).
IV
Notwithstanding the divine image in all humans, we are required to clearly differentiate between right and wrong, and distance ourselves from that which is wrong. A difficult balance is required of us in our dealings with, and attitude towards, non-observant Jews. They, like us, are described as children of Hashem (Devarim 4:1), worthy of additional love (Avos 3:18), even if they do not conduct themselves as proper sons (R' Meir, Kiddushin 36a). Yet, we must establish separation to insure that we remain observant even as we yearn to bring the non-observant closer to Torah. In a similar vein, most excruciatingly difficult is the balance required by talmedei chachamim in their dealings with, and attitude towards, unlearned observant Jews. If manifest love is not exhibited by Torah scholars towards observant amei haaretz, there is a risk of actions being misinterpreted. This in turn can lead to a schism within the observant community.
The Tosafos cited earlier does not say that a talmid chacham should not be aware of the cosmic spiritual importance of learning Torah, an awareness which perforce gives one a measure of pride when one is heavily engaged in Talmud Torah. However, Tosafos does demand that a talmid chacham not allow pride to convey a message of condescension towards the unlearned. In every circumstance a Torah scholar must strive to make his love for the unlearned manifestly clear. Otherwise, he bears some responsibility for the Akivas of his time, i.e. modest and refined people who think that chachamim reject or disdain them and, in turn, respond in kind.
V
The animosity generated by the lack of manifest love is a double catastrophe. Firstly, it prevents the masses from cleaving to chachamim and their students.
One who does not cling to chachamim, does not establish love for them in his heart, does not attempt to help them when he is able, violates this mitzvah. His punishment is great, because they are the endurance of Torah, and a strong foundation for the salvation of the souls. For one who associates with them will not quickly sin (Sefer Hachinuch 434)
Aside from the spiritual impoverishment and the greater possibility of sin consigned to those who do not fulfill this mitzvah, the second disaster is the disharmony that can develop within the observant community. This can lead to the type of baseless hatred which led to the churban.
We can now understand how character refinement, i.e., walking in the ways of Hashem, should result in cleaving to talmedei chachamim. When R' Akiva was exposed to true Torah scholars, his modesty and refinement of character, i.e. his walking in Hashem's ways, enabled him to penetrate the smokescreen of misunderstanding of his earlier stage of life and to adhere to talmedei chachamim. This progression from not only walking in Hashem's ways, but to cleaving to Torah scholars, lead, in R' Akiva's case, to his becoming the greatest chacham of his day.