Pride in Knowing Hashem
במדרש ומקנה רב כו' ג' מתנות כו' אל יתהלל חכם כו'
The Midrash, on the verse "and they had abundant livestock" (Bamidbar 32:1), brings the teaching of the three good gifts, along with the verse "Let not the wise man take pride in his wisdom... but rather in this let one who takes pride find his pride: in comprehending and knowing Me" (Yirmiyahu 9:22-23).
The Sfas Emes opens by linking the Torah's description of Reuven and Gad's great livestock to the Midrash's teaching about the three precious gifts and Yirmiyahu's caution against taking pride in wealth rather than in knowing Hashem.
פי' שדורש שהי' להם קנין באלה הנכסים יותר מדאי
The meaning is that the Midrash expounds that the tribes of Reuven and Gad had a sense of ownership and attachment to these possessions to an excessive degree.
He explains that these tribes were faulted for feeling an excessive attachment to and ownership over their material possessions.
לכן נק' בכתוב ומקנה רב וכמ"ש רש"י ז"ל שעשו מטפל עיקר
For this reason the verse calls it "abundant livestock" (mikneh rav), and as Rashi explains, that they made the secondary matter into the main thing.
The phrase "abundant livestock" itself, as Rashi notes, hints that they wrongly treated something secondary as if it were primary.
דבודאי זה העושר שייך להם
For certainly this wealth genuinely belonged to them.
He clarifies that the wealth itself was legitimately theirs; the problem was not the possession but the misplaced emphasis.
אך כתיב אל יתהלל שלא יהי' עיקר השמחה מאלה הדברים כמ"ש חז"ל חסידים ראשונים עשו תורתן קבע ומלאכתן עראי לכן עיקר השמחה בזאת יתהלל כו' השכל וידוע כו'
However, it is written "Let him not take pride," meaning that the essence of one's simchah should not stem from these material things, as Chazal taught that the early chassidim made their Torah the fixed center and their worldly labor merely incidental; therefore the essence of simchah is the conclusion of the verse, "but rather in this let one who takes pride find his pride: in comprehending and knowing Me."
The lesson is that simchah must flow from Torah and knowing Hashem rather than from material things, just as the early chassidim made Torah their fixed center and worldly work only incidental.
וממילא אלו ואלו נתקיימו בידן ועל זה כתיב באלה חפצתי
And as a consequence, both of these were sustained in their hands, and concerning this it is written "in these things I desire" (Yirmiyahu 9:23).
When a person keeps this order, both his Torah and his material life endure together, which is the meaning of "in these things I desire."
ומצד זה יכול להתהלל שיש לו מנוחה לידע את ה':
And by virtue of this a person is able to take pride, for he has the inner tranquility to know Hashem.
Only then can a person truly take pride, because his settled mind gives him the tranquility needed to know Hashem.
Summary: The Sfas Emes addresses why the Torah notes that the tribes of Reuven and Gad had abundant livestock, connecting it to the Midrash and to Yirmiyahu's teaching that a person should take pride not in wealth but in knowing Hashem. He explains that these tribes were faulted not for possessing wealth, which was rightfully theirs, but for an excessive attachment that made the secondary into the primary, as Rashi indicates. The proper path, modeled by the early chassidim who made Torah their fixed center and labor only incidental, is to draw one's simchah from Torah and dveikus rather than from material things. When a person maintains this order, both his Torah and his worldly life are sustained together, which is the meaning of "in these things I desire." Only then may a person take legitimate pride, for the inner tranquility this brings enables him to truly know Hashem.