Not one, not two... Bamidbar

Rashi - Bamidbar 1:1

The Lord spoke... in the Sinai Desert... on the first of the month :Because they were dear to Him, He counted them often. When they left Egypt, He counted them (Exod. 12:37); when [many] fell because [of the sin] of the golden calf, He counted them to know the number of the survivors (Exod. 32:28); when He came to cause His Divine Presence to rest among them, He counted them. On the first of Nissan, the Mishkan was erected, and on the first of Iyar, He counted them.

...משל לאדם,... [ש]היה לו פרגמטים אחת של מרגליות נאות, והיה נוטלה ומוציאה במנין, ומניחה במנין. כך כביכול, אמר הקדוש ברוך הוא ... : אתם בני ... לכך מונה אתכם בכל שעה...

A parable: A man had a stock of fine pearls which he used to count before taking out and count again before putting away. So, similarly, God says to the Israelites, "You are my children... and therefore I count you often." (Transl. R. Shai Held)

"שאו את ראש כל עדת". לפי שמעתה צריכים לארץ ישראל בני עשרים ראוים לצאת בצבא המלחמה.

Rashbam on Numbers 1:2

"Take ye the sum". Because at this point, they need men aged 20 [and up] to make a military to [conquer] the land of Israel.

שאו את ראש כל עדת בני ישראל - ... ואפשר שיהיה הטעם בזה, בעבור שאינו חזק למלחמה בפחות מעשרים, וכמו שאמרו (אבות ה כא): בן עשרים לרדוף....

"Take ye the sum" - A possible reason [for only counting men aged 20 and up] is that below age 20, one is not strong enough for battle, as it says (Mishnah Avot 5:21), "At age twenty one begins to pursue."

Akeidat Yitzhak, Numbers, #72

R. Isaac Arama (1420-1494) asks why all the seemingly dull details of the census are necessary. Did God not know the number of Israelites encamped in the desert in any case? Taking account of them one by one, R. Arama argues, serves to teach that each one has individual worth, and is not just a member of the collective. "They were all equal in stature," Arama writes, "and yet the stature of each one was different". (Courtesy of R. Shai Held)

Jacob Milgrom, JPS Torah Commentary (1991), Numbers 31:48-52, Excursus 2

The basis for the taboo against a census is not known, although one plausible suggestion has been offered: As the shepherd counts his sheep, so the counter of persons must be their owner, a title belonging solely to God and not to man.

Yoma 22b

A Tanna taught: Put forth your fingers for the count. But let him count them? — That supports the statement of R. Isaac, for R. Isaac said: It is forbidden to count Israel even for [the purpose of fulfilling] a commandment, as it is written: And he numbered them be-bezek [with pebbles]. R. Ashi demurred to this: Whence do you know that the word ‘bezek’ is here used in the sense of being broken [i.e., pebbles], perhaps it is the name of a place, as it is written: And they found Adoni-Bezek in Bezek? — Rather it is from here: And Saul summoned the people and numbered them with telaim [sheep].

R. Eleazar said: Whosoever counts Israel, transgresses a [biblical] prohibition, as it is said: Yet the number of the children of Israel shall be as the sand of the sea, which cannot be measured. R. Nahman b. Isaac said: He would transgress two prohibitions, for it is written: ‘Which cannot be measured nor numbered’. R. Samuel b. Nahmani said: R. Jonathan raised an objection: It is written: ‘Yet the number of the children of Israel shall be as the sand of the sea,’ and it is also written: ‘Which cannot be numbered?’ This is no contradiction: Here it speaks of the time when Israel fulfills the will of the Lord, there of the time when they do not fulfill His will. Rabbi, on behalf of Abba Jose son of Dosthai, said: This is no contradiction: Here it speaks of [counting done] by human beings, there of counting by Heaven.

R. Menachem Mendel Morgenstern of Kotzk, known as the Kotzker Rebbe

“Give me ten emesdike yiddin, and I will change the world."