Bamidbar4:22

נָשֹׂא אֶת־רֹאשׁ בְּנֵי גֵרְשׁוֹן גַּם־הֵם לְבֵית אֲבֹתָם לְמִשְׁפְּחֹתָם׃

"Take the count of the sons of Gershon too, by their fathers' houses, by their families.

Bamidbar 4:22

נָשֹׂא אֶת־רֹאשׁ בְּנֵי

Bamidbar / Numbers 4:22 · Drash

Bamidbar 4:22

נָשֹׂא אֶת־רֹאשׁ בְּנֵי גֵרְשׁוֹן גַּם־הֵם לְבֵית אֲבֹתָם לְמִשְׁפְּחֹתָם׃

"Take the count of the sons of Gershon too, by their fathers' houses, by their families.

Drash דְּרָשׁ

A crown open to everyone

Some things you get by birth: a surname, an inheritance, a place in line. Others you can only earn yourself. Which of these is worth more?

Kli Yakar: the ark was given not to Gershon the firstborn but to Kehat (Kohath), so that all would see that honour follows the Torah, not birthright. The crown of priesthood goes only to Aharon's descendants, the crown of kingship only to David's, but the crown of Torah is open to everyone. So the midrash says of the Torah: "It is more precious than pearls."

How Kli Yakar explain it

Kli Yakar Take the count of the sons of Gershon

It seems closer to the truth to say this. The Holy One, blessed is He, wished to show that "the wise shall inherit honour" (Mishlei / Proverbs 3:35), to teach the people to honour those who learn Torah and to call the holy of the Eternal honoured (Yeshayahu / Isaiah 58:13) in everything that touches holiness. So He counted Kehat first for the burden of the word of the Eternal that was with them. Had He given the ark to Gershon, the firstborn, I would say he is counted first for his birthright, and would not tie the honour to the burden of the ark. So He gave the ark to Kehat and counted him first, and all knew to honour the Torah and those who learn it.

But since the author of the midrash tied this to the verse "It is more precious than pearls" (Mishlei / Proverbs 3:15), as it is in the Rabbah, he surely meant to teach that the crown of Torah is open to all. So the ark was not given to the firstborn: so that he would not boast and say: "I am more worthy of the crown of Torah than others." No, in it all are equal. That is why it says: "It is more precious than pearls (מִפְּנִינִים)," that is, more than the high priest who goes within (לִפְנַי וְלִפְנִים). For only a descendant of Aharon (Aaron) attains the crown of priesthood, but the crown of Torah is open to all, and all can earn it.

"More precious than pearls": more than the crown of kingship, which has "gold and a multitude of pearls" (Mishlei / Proverbs 20:15), and only a descendant of David attains it. But anyone can attain the crown of Torah. For the same reason the Rabbah reads "more precious than pearls" as "more than the birthright," as it says: "Now this was the custom formerly (לְפָנִים) in Israel" (Rut / Ruth 4:7). For only the one born first attains the birthright, but anyone can attain the Torah.

Another explanation: the ark was not given to the firstborn so that he would not grow too proud. And some say the reason is that Moshe (Moses) and Aharon, who received the Torah, came from Kehat.

Takeaway

The midrash opens the account of the sons of Gershon with the verse "It is more precious than pearls" (Mishlei / Proverbs 3:15) and teaches that a sage ranks above a king of Israel (Bamidbar Rabbah 6:1).
The word "pearls" (פְּנִינִים) sounds like "within" (לִפְנַי וְלִפְנִים): so the high priest is described, who entered the holy of holies. So "more precious than pearls" means "more than the high priest."
The word "formerly" (לְפָנִים) in the book of Ruth also sounds like "pearls" (פְּנִינִים): hence the reading "more than the birthright."
Moshe and Aharon came from Kehat: their father Amram was a son of Kehat (Shemot / Exodus 6:18–20).