l'ilui nishmat R' Avraham ben Yona Ya'akov

“So that he not elevate his heart from his brothers nor to depart from the mitzvot right or left” (17:20)

The connection between these two attributes – prevention of pride and observance of mitzvot – can be explained based on the well known story in Shmuel 1. When Shaul sinned by not completely destroying Amalek and all his possessions, he tried to excuse himself before Shmuel “For the people took pity on the best of the flocks”. Shmuel said to him, “If you are small in your own eyes, nevertheless you are the head of the tribes of Israel” (Shmuel 1 15:16). The meaning of these words of chastisement is to say that even though a simple, private individual may take into account that “the people took pity”, and that would be sufficient excuse, because he would not be able to go against the will of the people. But before the head of the nation, that is the king, this is not an excuse, because he should have stood up to the people with strength to fulfil the mitzvah of G-d.
This is the meaning of this mitzvah here, that his heart should not become elevated. Even though he also doesn’t have permission to elevate himself above the people – ‘to trample on the heads of the holy nation’, yet despite that he must know how to use his authority when it is required for the honour of G-d, to not “depart from the mitzvah”.
Based on this explanation I also understood the meaning of the words regarding Yehoshafat king of Yehuda. “He raised his heart in the ways of G-d and removed the altars from the high places and the asheiras” (Divrei Hayamim 2 17:6). The connection between the raised heart in the ways of G-d and removing the altars is that Yehoshafat was modest and humble, as the verse in Melachim (22:43) testifies about him, and the Sages (Ketubot 103b) explained based on the verse in Tehillim (15:4) “Those who feared G-d were heavy upon Yehoshafat”. The Sages said that when he would see a Torah scholar he would stand up from his throne and hug and kiss him, and call him ‘my master, my master, my teacher, my teacher’. And he instructed the judges that he established in the cities of Yehuda and Yerushalayim in the fear of G-d with faithfulness and a full heart (Divrei Hayamim 2 19:6-9). He was very far from any kind of feeling of pride. Nevertheless, when it came to a matter of G-d’s honour, then he conducted himself with haughtiness and did what had to be done for this purpose, to remove the altars form the high places and the asheiras. He didn’t use his modesty as an excuse.
It is also possible with this explanation to understand the continuation of the verses in Tehillim (51:19) “the offerings to G-d are a humble spirit, a broken and lowly heart won’t reject G-d”. The meaning is that even though a person offers sacrifices to G-d though feeling humility and lowliness before G-d, and not becoming proud, since “G-d hates anyone who is proud” (Mishlei 16:8), and “Haughty eyes and proud heart, he will not eat” (Tehillim 101:5), and there are many other bad character traits connected to this trait of pride.
Nevertheless, this verse says that even though “an offering to G-d is a humble spirit, a broken and lowly heart”, yet they “won’t reject G-d”. In other words, despite all this, they may not use this character trait to become so attached to the trait of humility that it comes to degrading the word of G-d, to desecrate the holy things, or to desecrate the Torah and mitzvot.
This verse comes to teach and to limit the trait of modesty. With every trait there is a time to use it and a time to abandon it. As the Sages said (Shabbat 119b) ‘Yerushalayim was only destroyed because they didn’t reprove one another’. The explanation is that the Sages were so strong in their trait of modesty, to an extreme degree, that they felt that they were not worthy of reproaching others. This path of theirs led to the destruction of Yerushalayim and the exile of the Jewish people.
We find a similar concept in Gitin (55b): ‘The humility of Rabbi Zechariah destroyed our city’, and everything that is explained there, with the results of those events.
In the Talmud Sotah (5a) the Sages said: ‘A Torah scholar must have a tiny fraction (and eighth of an eighth) of pride’. Rashi explains the reason is that they should not allow the fools to mock them. And they should ensure that their words are heard by others. This explains the Talmud in Brachot (34b) that the king bows (at the beginning of the Amida and doesn’t straighten up until the end). Rashi explains that the greater a person is, the more they must humble and lower themselves. There it is referring to humility before G-d while praying. But this is not relevant to our discussion here. Look what we wrote about this on the last verse of the Torah.