Origins of Jewish demography: Censuses in Tanakh (Copy)
I. Censuses in the Torah

(יא) וַיְדַבֵּר ה' אֶל מֹשֶׁה לֵּאמֹר. (יב) כִּי תִשָּׂא אֶת רֹאשׁ בְּנֵי יִשְׂרָאֵל לִפְקֻדֵיהֶם וְנָתְנוּ אִישׁ כֹּפֶר נַפְשׁוֹ לַה' בִּפְקֹד אֹתָם וְלֹא יִהְיֶה בָהֶם נֶגֶף בִּפְקֹד אֹתָם. (יג) זֶה יִתְּנוּ כָּל הָעֹבֵר עַל הַפְּקֻדִים מַחֲצִית הַשֶּׁקֶל בְּשֶׁקֶל הַקֹּדֶשׁ עֶשְׂרִים גֵּרָה הַשֶּׁקֶל מַחֲצִית הַשֶּׁקֶל תְּרוּמָה לַה'. (יד) כֹּל הָעֹבֵר עַל הַפְּקֻדִים מִבֶּן עֶשְׂרִים שָׁנָה וָמָעְלָה יִתֵּן תְּרוּמַת ה'. (טו) הֶעָשִׁיר לֹא יַרְבֶּה וְהַדַּל לֹא יַמְעִיט מִמַּחֲצִית הַשָּׁקֶל לָתֵת אֶת תְּרוּמַת ה' לְכַפֵּר עַל נַפְשֹׁתֵיכֶם. (טז) וְלָקַחְתָּ אֶת כֶּסֶף הַכִּפֻּרִים מֵאֵת בְּנֵי יִשְׂרָאֵל וְנָתַתָּ אֹתוֹ עַל עֲבֹדַת אֹהֶל מוֹעֵד וְהָיָה לִבְנֵי יִשְׂרָאֵל לְזִכָּרוֹן לִפְנֵי ה' לְכַפֵּר עַל נַפְשֹׁתֵיכֶם.

(11) And the LORD spoke unto Moses, saying: (12) ’When thou takest the sum of the children of Israel, according to their number, then shall they give every man a ransom for his soul unto the LORD, when thou numberest them; that there be no plague among them, when thou numberest them. (13) This they shall give, every one that passeth among them that are numbered, half a shekel after the shekel of the sanctuary—the shekel is twenty gerahs—half a shekel for an offering to the LORD. (14) Every one that passeth among them that are numbered, from twenty years old and upward, shall give the offering of the LORD. (15) The rich shall not give more, and the poor shall not give less, than the half shekel, when they give the offering of the LORD, to make atonement for your souls. (16) And thou shalt take the atonement money from the children of Israel, and shalt appoint it for the service of the tent of meeting, that it may be a memorial for the children of Israel before the LORD, to make atonement for your souls.’

"ולא יהיה בהם נגף" - שהמניין, שולט בו עין הרע, והדֶבֶר בא עליהם, כמו שמצינו בימי דוד (ראה דברי הימים א כא יד):

"That there be no plague among them": For during a census, the Evil Eye presides, and plague comes to them, as was the case during the reign of David (I Chronicles 21:14).

II. King David's census - two versions

(א) וַיֹּסֶף אַף ה' לַחֲרוֹת בְּיִשְׂרָאֵל וַיָּסֶת אֶת דָּוִד בָּהֶם לֵאמֹר לֵךְ מְנֵה אֶת יִשְׂרָאֵל וְאֶת יְהוּדָה. (ב) וַיֹּאמֶר הַמֶּלֶךְ אֶל יוֹאָב שַׂר הַחַיִל אֲשֶׁר אִתּוֹ שׁוּט נָא בְּכָל שִׁבְטֵי יִשְׂרָאֵל מִדָּן וְעַד בְּאֵר שֶׁבַע וּפִקְדוּ אֶת הָעָם וְיָדַעְתִּי אֵת מִסְפַּר הָעָם. (ג) וַיֹּאמֶר יוֹאָב אֶל הַמֶּלֶךְ וְיוֹסֵף ה' אֱלֹקֶיךָ אֶל הָעָם כָּהֵם וְכָהֵם מֵאָה פְעָמִים וְעֵינֵי אֲדֹנִי הַמֶּלֶךְ רֹאוֹת וַאדֹנִי הַמֶּלֶךְ לָמָּה חָפֵץ בַּדָּבָר הַזֶּה. (ד) וַיֶּחֱזַק דְּבַר הַמֶּלֶךְ אֶל יוֹאָב וְעַל שָׂרֵי הֶחָיִל וַיֵּצֵא יוֹאָב וְשָׂרֵי הַחַיִל לִפְנֵי הַמֶּלֶךְ לִפְקֹד אֶת הָעָם אֶת יִשְׂרָאֵל. (ה) וַיַּעַבְרוּ אֶת הַיַּרְדֵּן וַיַּחֲנוּ בַעֲרוֹעֵר יְמִין הָעִיר אֲשֶׁר בְּתוֹךְ הַנַּחַל הַגָּד וְאֶל יַעְזֵר. (ו) וַיָּבֹאוּ הַגִּלְעָדָה וְאֶל אֶרֶץ תַּחְתִּים חָדְשִׁי וַיָּבֹאוּ דָּנָה יַּעַן וְסָבִיב אֶל צִידוֹן. (ז) וַיָּבֹאוּ מִבְצַר צֹר וְכָל עָרֵי הַחִוִּי וְהַכְּנַעֲנִי וַיֵּצְאוּ אֶל נֶגֶב יְהוּדָה בְּאֵר שָׁבַע. (ח) וַיָּשֻׁטוּ בְּכָל הָאָרֶץ וַיָּבֹאוּ מִקְצֵה תִשְׁעָה חֳדָשִׁים וְעֶשְׂרִים יוֹם יְרוּשָׁלָ‍ִם. (ט) וַיִּתֵּן יוֹאָב אֶת מִסְפַּר מִפְקַד הָעָם אֶל הַמֶּלֶךְ וַתְּהִי יִשְׂרָאֵל שְׁמֹנֶה מֵאוֹת אֶלֶף אִישׁ חַיִל שֹׁלֵף חֶרֶב וְאִישׁ יְהוּדָה חֲמֵשׁ מֵאוֹת אֶלֶף אִישׁ. (י) וַיַּךְ לֵב דָּוִד אֹתוֹ אַחֲרֵי כֵן סָפַר אֶת הָעָם וַיֹּאמֶר דָּוִד אֶל ה' חָטָאתִי מְאֹד אֲשֶׁר עָשִׂיתִי וְעַתָּה ה' הַעֲבֶר נָא אֶת עֲו‍ֹן עַבְדְּךָ כִּי נִסְכַּלְתִּי מְאֹד. (יא) וַיָּקָם דָּוִד בַּבֹּקֶר וּדְבַר ה' הָיָה אֶל גָּד הַנָּבִיא חֹזֵה דָוִד לֵאמֹר. (יב) הָלוֹךְ וְדִבַּרְתָּ אֶל דָּוִד כֹּה אָמַר ה' שָׁלֹשׁ אָנֹכִי נוֹטֵל עָלֶיךָ בְּחַר לְךָ אַחַת מֵהֶם וְאֶעֱשֶׂה לָּךְ. (יג) וַיָּבֹא גָד אֶל דָּוִד וַיַּגֶּד לוֹ וַיֹּאמֶר לוֹ הֲתָבוֹא לְךָ שֶׁבַע שָׁנִים רָעָב בְּאַרְצֶךָ אִם שְׁלֹשָׁה חֳדָשִׁים נֻסְךָ לִפְנֵי צָרֶיךָ וְהוּא רֹדְפֶךָ וְאִם הֱיוֹת שְׁלֹשֶׁת יָמִים דֶּבֶר בְּאַרְצֶךָ עַתָּה דַּע וּרְאֵה מָה אָשִׁיב שֹׁלְחִי דָּבָר. (יד) וַיֹּאמֶר דָּוִד אֶל גָּד צַר לִי מְאֹד נִפְּלָה נָּא בְיַד ה' כִּי רַבִּים רחמו [רַחֲמָיו] וּבְיַד אָדָם אַל אֶפֹּלָה. (טו) וַיִּתֵּן ה' דֶּבֶר בְּיִשְׂרָאֵל מֵהַבֹּקֶר וְעַד עֵת מוֹעֵד וַיָּמָת מִן הָעָם מִדָּן וְעַד בְּאֵר שֶׁבַע שִׁבְעִים אֶלֶף אִישׁ...

(1) And again the anger of the LORD was kindled against Israel, and He moved David against them, saying: ‘Go, number Israel and Judah.’ (2) And the king said to Joab the captain of the host that was with him: ‘Go now to and fro through all the tribes of Israel, from Dan even to Beer-sheba, and number ye the people, that I may know the sum of the people.’ (3) And Joab said unto the king: ‘Now the LORD thy God add unto the people, how many soever they may be, a hundredfold, and may the eyes of my lord the king see it; but why doth my lord the king delight in this thing?’ (4) Notwithstanding the king’s word prevailed against Joab, and against the captains of the host. And Joab and the captains of the host went out from the presence of the king, to number the people of Israel. (5) And they passed over the Jordan, and pitched in Aroer, on the right side of the city that is in the middle of the valley of Gad, and unto Jazer; (6) then they came to Gilead, and to the land of Tahtim-hodshi; and they came to Dan-jaan, and round about to Zidon, (7) and came to the stronghold of Tyre, and to all the cities of the Hivites, and of the Canaanites; and they went out to the south of Judah, at Beer-sheba. (8) So when they had gone to and fro through all the land, they came to Jerusalem at the end of nine months and twenty days. (9) And Joab gave up the sum of the numbering of the people unto the king; and there were in Israel 800,000 valiant men that drew the sword; and the men of Judah were 500,000 men. (10) And David’s heart smote him after that he had numbered the people. And David said unto the LORD: ‘I have sinned greatly in what I have done; but now, O LORD, put away, I beseech Thee, the iniquity of Thy servant; for I have done very foolishly.’ (11) And when David rose up in the morning, the word of the LORD came unto the prophet Gad, David’s seer, saying: (12) ’Go and speak unto David: Thus saith the LORD: I lay upon thee three things; choose thee one of them, that I may do it unto thee.’ (13) So Gad came to David, and told him, and said unto him: ‘Shall seven years of famine come unto thee in thy land? or wilt thou flee three months before thy foes while they pursue thee? or shall there be three days’pestilence in thy land? now advise thee, and consider what answer I shall return to Him that sent Me.’ (14) And David said unto Gad: ‘I am in a great strait; let us fall now into the hand of the LORD; for His mercies are great; and let me not fall into the hand of man.’ (15) So the LORD sent a pestilence upon Israel from the morning even to the time appointed; and there died of the people from Dan even to Beer-sheba seventy thousand men...

(א) וַיַּעֲמֹד שָׂטָן עַל יִשְׂרָאֵל וַיָּסֶת אֶת דָּוִיד לִמְנוֹת אֶת יִשְׂרָאֵל. (ב) וַיֹּאמֶר דָּוִיד אֶל יוֹאָב וְאֶל שָׂרֵי הָעָם לְכוּ סִפְרוּ אֶת יִשְׂרָאֵל מִבְּאֵר שֶׁבַע וְעַד דָּן וְהָבִיאוּ אֵלַי וְאֵדְעָה אֶת מִסְפָּרָם. (ג) וַיֹּאמֶר יוֹאָב יוֹסֵף ה' עַל עַמּוֹ כָּהֵם מֵאָה פְעָמִים הֲלֹא אֲדֹנִי הַמֶּלֶךְ כֻּלָּם לַאדֹנִי לַעֲבָדִים לָמָּה יְבַקֵּשׁ זֹאת אֲדֹנִי לָמָּה יִהְיֶה לְאַשְׁמָה לְיִשְׂרָאֵל. (ד) וּדְבַר הַמֶּלֶךְ חָזַק עַל יוֹאָב וַיֵּצֵא יוֹאָב וַיִּתְהַלֵּךְ בְּכָל יִשְׂרָאֵל וַיָּבֹא יְרוּשָׁלָ‍ִם. (ה) וַיִּתֵּן יוֹאָב אֶת מִסְפַּר מִפְקַד הָעָם אֶל דָּוִיד וַיְהִי כָל יִשְׂרָאֵל אֶלֶף אֲלָפִים וּמֵאָה אֶלֶף אִישׁ שֹׁלֵף חֶרֶב וִיהוּדָה אַרְבַּע מֵאוֹת וְשִׁבְעִים אֶלֶף אִישׁ שֹׁלֵף חָרֶב. (ו) וְלֵוִי וּבִנְיָמִן לֹא פָקַד בְּתוֹכָם כִּי נִתְעַב דְּבַר הַמֶּלֶךְ אֶת יוֹאָב. (ז) וַיֵּרַע בְּעֵינֵי הָאֱלֹקִים עַל הַדָּבָר הַזֶּה וַיַּךְ אֶת יִשְׂרָאֵל. (ח) וַיֹּאמֶר דָּוִיד אֶל הָאֱלֹקִים חָטָאתִי מְאֹד אֲשֶׁר עָשִׂיתִי אֶת הַדָּבָר הַזֶּה וְעַתָּה הַעֲבֶר נָא אֶת עֲווֹן עַבְדְּךָ כִּי נִסְכַּלְתִּי מְאֹד. (ט) וַיְדַבֵּר ה' אֶל גָּד חֹזֵה דָוִיד לֵאמֹר. (י) לֵךְ וְדִבַּרְתָּ אֶל דָּוִיד לֵאמֹר כֹּה אָמַר ה' שָׁלוֹשׁ אֲנִי נֹטֶה עָלֶיךָ בְּחַר לְךָ אַחַת מֵהֵנָּה וְאֶעֱשֶׂה לָּךְ. (יא) וַיָּבֹא גָד אֶל דָּוִיד וַיֹּאמֶר לוֹ כֹּה אָמַר ה' קַבֶּל לָךְ. (יב) אִם שָׁלוֹשׁ שָׁנִים רָעָב וְאִם שְׁלֹשָׁה חֳדָשִׁים נִסְפֶּה מִפְּנֵי צָרֶיךָ וְחֶרֶב אוֹיְבֶךָ לְמַשֶּׂגֶת וְאִם שְׁלֹשֶׁת יָמִים חֶרֶב ה' וְדֶבֶר בָּאָרֶץ וּמַלְאַךְ ה' מַשְׁחִית בְּכָל גְּבוּל יִשְׂרָאֵל וְעַתָּה רְאֵה מָה אָשִׁיב אֶת שֹׁלְחִי דָּבָר. (יג) וַיֹּאמֶר דָּוִיד אֶל גָּד צַר לִי מְאֹד אֶפְּלָה נָּא בְיַד ה' כִּי רַבִּים רַחֲמָיו מְאֹד וּבְיַד אָדָם אַל אֶפֹּל. (יד) וַיִּתֵּן ה' דֶּבֶר בְּיִשְׂרָאֵל וַיִּפֹּל מִיִּשְׂרָאֵל שִׁבְעִים אֶלֶף אִישׁ....

(1) And Satan stood up against Israel, and moved David to number Israel. (2) And David said to Joab and to the princes of the people: ‘Go, number Israel from Beersheba even to Dan; and bring me word, that I may know the sum of them.’ (3) And Joab said: ‘The LORD make His people a hundred times so many more as they are; but, my lord the king, are they not all my lord’s servants? why doth my lord require this thing? why will he be a cause of guilt unto Israel?’ (4) Nevertheless the king’s word prevailed against Joab. Wherefore Joab departed and went throughout all Israel, and came to Jerusalem. (5) And Joab gave up the sum of the numbering of the people unto David. And all they of Israel were a 1,100,000 men that drew sword; and Judah was 470,000 men that drew sword. (6) But Levi and Benjamin he did not number among them; for the king’s word was abominable to Joab. (7) And God was displeased with this thing; therefore He smote Israel. (8) And David said unto God: ‘I have sinned greatly, in that I have done this thing; but now, put away, I beseech Thee, the iniquity of Thy servant; for I have done very foolishly.’ (9) And the LORD spoke unto Gad, David’s seer, saying: (10) ’Go and speak unto David, saying: Thus saith the LORD: I offer thee three things; choose thee one of them, that I may do it unto thee.’ (11) So Gad came to David, and said unto him: ‘Thus saith the LORD: Take which thou wilt: (12) either three years of famine; or three months to be swept away before thy foes, while the sword of thine enemies overtaketh thee; or else three days the sword of the LORD, even pestilence in the land, and the angel of the LORD destroying throughout all the borders of Israel. Now therefore consider what answer I shall return to Him that sent me.’ (13) And David said unto Gad: ‘I am in a great strait; let me fall now into the hand of the LORD, for very great are His mercies; and let me not fall into the hand of man.’ (14) So the LORD sent a pestilence upon Israel; and there fell of Israel seventy thousand men...

III. What is the significance of a census? First explanation
(ה) וַיִּקְבֹּץ אֲמַצְיָהוּ אֶת יְהוּדָה וַיַּעֲמִידֵם לְבֵית אָבוֹת לְשָׂרֵי הָאֲלָפִים וּלְשָׂרֵי הַמֵּאוֹת לְכָל יְהוּדָה וּבִנְיָמִן וַיִּפְקְדֵם לְמִבֶּן עֶשְׂרִים שָׁנָה וָמַעְלָה וַיִּמְצָאֵם שְׁלֹשׁ מֵאוֹת אֶלֶף בָּחוּר יוֹצֵא צָבָא אֹחֵז רֹמַח וְצִנָּה.
(5) Moreover Amaziah gathered Judah together, and ordered them according to their fathers’houses, under captains of thousands and captains of hundreds, even all Judah and Benjamin; and he numbered them from twenty years old and upward, and found them three hundred thousand chosen men, able to go forth to war, that could handle spear and shield.

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."

(א) כל יוצא צבא בישראל מגיד שאין יוצא לצבא פחות מבן עשרים שנה שאו את ראש כל עדת בני ישראל כמו שאומרים לקוסטינר ארים רישיה דדין לשון רש"י ואפשר שיהיה הטעם בזה בעבור שאינו חזק למלחמה בפחות מעשרים וכמו שאמרו (אבות ה כא) בן עשרים לרדוף אבל יתכן שיהיה פירוש כל יוצא צבא כל היוצאים להקהל בעדה כי הנערים לא יקהלו בתוך העם כי כל אסיפת עם תקרא צבא וכן לצבא צבא בעבודת אהל מועד (במדבר ח׳:כ״ד) ישוב מצבא העבודה (שם פסוק כה) במראות הצובאות אשר צבאו (שמות לח ח) וכן צבא השמים (מלכים א כב יט) וכל צבאם צויתי (ישעיהו מה יב) ולכך יפרש באנשי המלחמה מצבא המלחמה (במדבר ל״א:י״ד) והתיחשם בצבא במלחמה (דהי"א ז מ) ואמר כאן כל יוצא צבא כדרך כל יוצאי שער עירו (בראשית לד כד) ואמר לצבאותם שהם צבאות רבות כי כל שבט ושבט צבא גדול והלשון שכתב רש"י כמו שאומרים לקוסטינר ארים רישיה דפלן לא נתברר לי למה דרשו אותו לגנאי אם מפני שמתו במדבר ובמטה לוי אמר (במדבר ג׳:ט״ו) פקוד לפי שלא היו בכלל גזרה והלא במנין שני של באי הארץ נאמר כן (במדבר כ״ו:ב׳) שאו את ראש כל עדת בני ישראל אבל בהגדה של ויקרא רבה דורש לשבח אין שאו אלא לשון גדולה כמו דכתיב (בראשית מ יג) ישא פרעה את ראשך והשיבך על כנך אמר הקב"ה לישראל נתתי לכם תלוי ראש ודמיתי אתכם לי כשם שיש לי תלוי ראש על כל באי עולם שנאמר (דברי הימים א כט יא) לך ה' הממלכה והמתנשא לכל לראש אף לכם עשיתי תלוי ראש שנאמר שאו את ראש כל עדת בני ישראל לקיים מה שנאמר (תהלים קמח יד) וירם קרן לעמו וכן הוא אומר (דברים כח א) ונתנך ה' אלקיך עליון על כל גויי הארץ ושוב מצאתי במדבר סיני רבה (במדבר רבה א׳:ט׳) שאמרו אמר רבי פנחס אמר רבי אידי מאי דכתיב בראש הספר שאו את ראש רוממו את ראש גדלו את ראש לא נאמר אלא שאו את ראש כאדם שאומר לקוסטינר סב רישיה דפלן כאן נתן רמז למשה שאו את ראש שאם יזכו יעלו לגדולה כמה דכתיב ישא פרעה את ראשך והשיבך על כנך ואם לא יזכו ימותו כלם כמה דכתיב (בראשית מ יט) ישא פרעה את ראשך מעליך ותלה אותך על עץ והנה הלשון כפי הכונה יתפרש בטובה לטובים וכיון שהוא לשון גדולה ונאמר כן במנין הראשון אמר כן במנין השני: (ב) תפקדו אותם ענין פקידה זכרון והשגחה על דבר כלשון וה' פקד את שרה כאשר אמר (בראשית כא א) והוא פתרונו בכל מקום לא ימלט מהן איש על דעתי וגם פקדון מפני ששמירתו והשגחתו עליו וכאשר צוה למנות את ישראל יאמר תפקדו אותם לרמוז שלא יספרם רק שיתנו כופר נפשם מחצית השקל ובהם ישגיח וידע מספר העם ואמר בדוד מספר מפקד העם ( כד ט) כי ידע מספרם בפקידת הכופר כי רחוק הוא אצלי שלא יזהר דוד במה שאמר הכתוב (שמות ל יב) ולא יהיה בהם נגף בפקוד אותם ואם אולי טעה דוד למה לא עשה יואב שקלים והיה דבר המלך נתעב אצלו והוא אמר לו למה יבקש זאת אדושם למה יהיה לאשמה לישראל (דהי"א כא ג) ולמה לא ימנם בשקלים שלא יחטא אבל כפי דעתי היה הקצף עליו בעבור שמנאם שלא לצורך כי לא היה יוצא למלחמה ולא עושה בהם דבר בעת ההיא רק לשמח לבו שמלך על עם רב והוא מאמר יואב ( כד ג) ויוסף ה' אלקיך אל העם כהם וכהם מאה פעמים וגו' ואדוני המלך למה חפץ בדבר הזה וראיתי במדבר סיני רבה (במדבר רבה ב׳:י״ז) ר' אליעזר בשם ר' יוסי בן זמרא אמר כל זמן שנמנו ישראל לצורך לא חסרו שלא לצורך חסרו איזה זמן נמנו לצורך בימי משה ובדגלים ובחלוק הארץ שלא לצורך בימי דוד ויתכן עוד שנפרש ונאמר כי דוד צוה למנות כל איש ישראל רצוני לומר מבן שלש עשרה שנה ומעלה שהוא איש כי לא נזכר במנינו מבן עשרים שנה ומעלה אבל אמר לכו ספרו את ישראל וגו' ואדעה את מספרם (דברי הימים א כא ב) וזה היה ענשו כי הכתוב לא הרשה למנות רק מבן עשרים שנה ומעלה בשקלים ומפני שזה איננו מפורש בכתוב טעה בו כי חשב במה שאמר ולא יהיה בהם נגף שהוא בשקלים שהם כופר להם אבל יואב נתן לבו וחשש לדבר והכתוב מעורר לבי בזה במה שאמר (שם כז כג כד) ולא נשא דוד מספרם למבן עשרים שנה ולמטה כי אמר ה' להרבות את ישראל ככוכבי השמים יואב בן צרויה החל למנות ולא כלה ויהי בזאת קצף על ישראל היה נראה שמנין יואב היה למטה מבן עשרים והוא היה הקצף שאין ה' חפץ שיהו כל ישראל בגדר מנין שהוא ירבם ככוכבי השמים כאשר אמר (בראשית טו ה) אם תוכל לספור אותם והכתוב שאמר במנין ההוא (דברי הימים א כא ה) ויהיו כל ישראל אלף אלפים ומאה אלף איש שולף חרב אין ענינו שהיו כולם יוצא צבא בישראל אבל פתרונו שהיו בריאים וחזקים למלחמה הגיד כי לא מנה החולים והחלשים והזקנים מפני שהיה דבר המלך נתעב אצלו וזה ענין הגון מאד ועל דעת מדרש אגדה (ברכות סב) שהיה שם מנין ממש טעו כלם ולכך אמר ( כד א) לך מנה את ישראל וכתיב (שם פסוק י) אחרי כן ספר את העם כי בתורה לא נזכרה בהם ספירה כלל כי טעם במספר שמות יגידו כל אחד שמותם בפקוד אותם בכופר:
(1) ... Record (tifkedu) them: The matter of recording, remembering and guarding something - like the words (Genesis 21:1), "And the Lord remembered Sarah" - is the understanding of [pakad] in every place. Even [with a] pikadon (deposit) - it is [called that] because its guarding and supervision is upon [the holder]. And when [God] commanded to count the people of Israel, He said, "tifkod them," in order to hint not to [actually] count them, but rather that they should give a ransom for their lives, a half shekel - and through them, He would oversee and remember the multitude of the people. And it states with David (II Samuel 24:9), "the number of the record of the people," as he knew their number by recording the ransom (the coins). For it appears distant to me that David would not be careful about what Scripture stated (Exodus 30:12), "so there shall not be a plague in recording them." And [even] if David may have erred, why would Joav not make [the count according to] shekels? And since the matter was disgusting to Joav - as he said to him (I Chronicles 21:3), "my lord king, are they not all subjects of my lord; why should my lord require this; why should it be a cause of guilt for Israel” - why did Joab not count them with shekels, so that he not sin? But in my opinion, the [divine] anger against [David] was because he counted them unnecessarily. For he was not going to war and he was not doing anything with them at that time. Rather his whole intention was to gladden his heart, [to ascertain] that he ruled over many people. And that is [the meaning] of Joab's statement (II Samuel 24:3), "May the Lord your God increase the number of the people a hundredfold, while your own eyes see it; but why should my lord king want this?"...
Nahum Sarna, JPS Torah Commentary (1991), Exodus 30:11-16
There may have been sound historical reasons for Joab's reaction (see II Samuel 24 and I Chronicles 21, above --EF), for a census almost invariably portended preparation for war or the imposition of a new tax.
Sarna also writes that there is a relationship between the English word "census" (from the Latin 'censere') and the Hebrew word קנס, which means "fine" or "penalty."
IV. Significance of a census: Second explanation

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

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)

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)

Radak on II Samuel 24:1

...וכבר היה דבר זה נודע בישראל מן התורה כי אם ימנו את ישראל שלא יתנו איש כופר נפשו שיהיה בהם נגף ואפילו ימנה אותם לצורך וצוה דוד את יואב שימנה אותם והיה קשה בעיני יואב לעשות זה הדבר לפי שידע שיחסרו וכן אמר בדברי הימים למה יהיה לאשמה לישראל ואע"פ שיקח מהם כסף או שום דבר כיון שימנה אותם שלא לצורך יחסרו כמו שפי' למעלה בפסוק ויפקדם בטלאים ואמרו רז"ל כל זמן שנמנו ישראל לצורך לא חסרו שלא לצורך חסרו כמו בימי דוד לפיכך היה קשה בעיני יואב לעשות זה הדבר עד שחזק דבר המלך אל יואב ועל שרי החיל...

It was already known among the Israelites, based on the Torah, that if they were to count the Israelites without each person giving a ransom, there would be a plague, even if the counting was for a legitimate purpose. David commanded Joab to count the people, and this command was difficult for Joab to accept this, because he knew they would lose out from it. And so it says in Chronicles, "why will he be a cause of guilt unto Israel?". And even if he did take money or some other object [as a ransom], if the counting was not for a legitimate purpose, they would lose out, as I wrote earlier. Our sages said: "Any time Israel was counted for a legitimate purpose, they did not lose out. But when there was no legitimate purpose, they lost out, such as in the time of David." That is why this command was difficult for Joab to accept, until the king's command overruled Joab and the other generals.

Jacob Milgrom, JPS Torah Commentary (1991), Numbers 31:48-52 and 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.
V. One attempt at a synthesis
A.F. Kirkpatrick, The Second Book of Samuel, with notes and introduction. Cambridge, England: The University Press, 1908. (Separate sheet)

Notes on sources:
  • Rashi: 1040-1105, northern France.
  • Rashbam: c. 1085-1158, northern France. Grandson of Rashi.
  • Ramban: 1194-1270, Spain/Catalonia and, at the end of his life, the land of Israel.
  • Radak: 1160-1235, Provence (southern France).
  • Bemidbar Rabbah: Homiletic midrash. There is no scholarly consensus on its dates of authorship.
  • Akeidat Yitzhak: R' Isaac ben Moses Arama, 1420-1494, Spain and, after 1492, Italy.
  • Nahum Sarna: 1923-2005, United Kingdom and United States (University College London, Gratz College, Jewish Theological Seminary, and Brandeis University).
  • Jacob Milgrom: 1923-2010, United States (University of California - Berkeley).
  • A. F. Kirkpatrick: 1849-1940, United Kingom (Cambridge University).
Translations of Biblical passages are from the old JPS translation (1917). Translations of Rashi, Rashbam, Ramban, and Radak are my own. Translation of Akeidat Yitzhak is by R. Shai Held. Contemporary sources were written originally in English.