There are several sources:
- Rav Moshe Feinstein (as brought down in Tallelei Oros on Bamidbar) - Counting inspires self-worth.
Rav Moshe brings similar to your first point (that it connects to the counting of the Jewish people) that people may question their ability in Torah study and adopt a defeatist attitude. They may say, "I'm a nobody, and even if I do toil in Torah I won't really achieve much!" This mindset will lead to them giving up and becoming lazy in their Torah pursuit. As such, we read Bamidbar specifically before Shavuos, which details the count, as it underlines how each and every Jew, whether young or old, is meaningful and counts!
Therefore:
כי כל אדם מישראל יש לו חשיבות וערך והריהו מן הכלל כולו. קריאה בפרשת זו יש בה משום חיזוק לאדם לקראת קבלת התורה
Because every person from Israel has an importance and worth and is different from the whole community. Reading this parsha is a chizuk for a person going into the acceptance of the Torah.
- Tosafos s.v. "Klalos" - Megillah 31b - It serves a functional purpose
אנו קורין במדבר סיני קודם עצרת כדי שלא להסמיך הקללות שבבחוקותי לעצרת
We read Parshas Bamidbar prior to Shavuos in order not to have the curses that are listed in Bechukosai before Shavuos.
- Chidah - it serves as a uniting force similar to that of Mattan Torah
He writes in Nachal Kedumim that "במדבר סיני" is the same gematriah (numerical value) as "בשלום" - in other words, from the day the Jewish people left Egypt they were in a fractious state. However, when they arrived at Sinai they came together and united as one - as it says in Shemos 19:2:
ויחן שם ישראל - And Israel camped there
Which Rashi famously notes:
כאיש אחד בלב אחד
Like one man with one heart
- Gemara Nedarim 55a - A desert is reminder to be humble - a crucial tenet for the acquisition of Torah
The Gemara writes:
מַאי דִּכְתִיב: ״וּמִמִּדְבָּר מַתָּנָה וּמִמַּתָּנָה נַחֲלִיאֵל וּמִנַּחֲלִיאֵל בָּמוֹת״? אֲמַר לֵיהּ: כֵּיוָן שֶׁעוֹשֶׂה אָדָם אֶת עַצְמוֹ כַּמִּדְבָּר, שֶׁהוּא מוּפְקָר לַכֹּל — תּוֹרָה נִיתְּנָה לוֹ בְּמַתָּנָה, שֶׁנֶּאֱמַר: ״וּמִמִּדְבָּר מַתָּנָה״. וְכֵיוָן שֶׁנִּיתְּנָה לוֹ בְּמַתָּנָה — נְחָלוֹ אֵל, שֶׁנֶּאֱמַר: ״וּמִמַּתָּנָה נַחֲלִיאֵל״. וְכֵיוָן שֶׁנְּחָלוֹ אֵל — עוֹלֶה לִגְדוּלָּה, שֶׁנֶּאֱמַר: ״וּמִנַּחֲלִיאֵל בָּמוֹת״. וְאִם הִגְבִּיהַּ עַצְמוֹ — הַקָּדוֹשׁ בָּרוּךְ הוּא מַשְׁפִּילוֹ, שֶׁנֶּאֱמַר: ״וּמִבָּמוֹת הַגַּיְא״, וְלֹא עוֹד אֶלָּא שֶׁשּׁוֹקְעִין אוֹתוֹ בַּקַּרְקַע, שֶׁנֶּאֱמַר: ״וְנִשְׁקָפָה עַל פְּנֵי הַיְשִׁימוֹן״. וְאִם חוֹזֵר בּוֹ — הַקָּדוֹשׁ בָּרוּךְ הוּא מַגְבִּיהוֹ
What is the meaning of that which is written: “And from the wilderness Mattana and from Mattana Nahaliel, and from Nahaliel Bamot” (Bamidbar 21:18–19)? Rava said to him that it means: Once a person renders himself like a wilderness, deserted before all, the Torah is given to him as a gift [mattana], as it is stated: “And from the wilderness Mattana.” And once it is given to him as a gift, God bequeaths [naḥalo] it to him, as it is stated: “And from Mattana Nahaliel.” And once God bequeaths it to him, he rises to greatness, as it is stated: And from Nahaliel, Bamot, which are elevated places. And if he elevates himself and is arrogant about his Torah, the Holy One, Blessed be He, degrades him, as it is stated: “And from Bamot the valley” (Numbers 21:20). And not only is he degraded, but one lowers him into the ground, as it is stated: “And looking over [nishkafa] the face of the wasteland” (Numbers 21:20), like a threshold [iskopa] that is sunken into the ground. And if he reverses his arrogance and becomes humble, the Holy One, Blessed be He, elevates him
Thus, just a desert is devoid of life and is completely empty, if a person want to truly be ready to acquire Torah he also has to make himself "empty" - In other words, he has to become humble and then he will be more able to readily acquire the Torah. Hence we read parshas Bamidbar prior to Shavuos as a necessary preparation going into zman mattan toraseinu.