Another interpretation: "And the LORD spoke to Moses in the wilderness of Sinai, etc." This is what Scripture says: "He has not done so for any nation, etc." (Psalms 147:20), and likewise: "And He has raised up a horn for His people, praise for all His pious ones" (ibid. 148:14). A parable of a king who married a first wife and did not write her a marriage contract (ketubah); he divorced her and did not write her a bill of divorce (get). So he did to the second and to the third, and he wrote for them neither a marriage contract nor a bill of divorce. In time he saw a certain poor woman, an orphan, a daughter of noble ancestors, and he sought to take her. He said to his groomsman: Do not treat her as the former ones. This one is a daughter of noble ancestors, she is modest in her deeds and worthy. Write her a marriage contract — in which week, in which year, in which month, on which day of the month, in which province (eparchia) — just as it is written concerning Esther: "And Esther was taken to King Ahasuerus, to his royal house, in the tenth month, which is the month of Tevet, in the seventh year of his reign" (Esther 2:16). So, as it were, He created the generation of the Flood, and did not write down when He created them; He removed them from the world, and did not write down when He removed them — rather, "On this day all the fountains of the great deep burst forth, and the windows of the heavens were opened" (Genesis 7:11). And likewise for the generation of the Dispersion, [and likewise for the Sodomites,] and likewise for the Egyptians: He did not write for them when they were created nor when they died. But when Israel arose, the Holy One, blessed be He, said to Moses: I do not treat these as those former ones. These are children of noble ancestors, they are children of Abraham, Isaac, and Jacob; therefore write for them in which month, on which day of the month, in which year, and in which province, in which country I exalted their horn and gave them a lifting of the head. Therefore it is said, "And the LORD spoke to Moses in the wilderness of Sinai" — that is the province; "in the Tent of Meeting" — that is the country; in which year — "in the second year"; in which month — "in the second month"; on which day of the month — "on the first of the month"; [from their going out of the land of Egypt] — thus the era (consulship) was written. Why? "Take the head-count of all the congregation of the children of Israel, etc." — to fulfill what is said, "He has not done so for any nation, etc." What did He do? "And He has raised up a horn for His people, praise for all His pious ones, for the children of Israel, the people near to Him. Hallelujah" (Psalms 148:14).
Why God Dated Israel's Census Like a Marriage Contract
Midrash Tanchuma Buber, Bamidbar 5:1
ד"א וידבר ה' אל משה במדבר סיני וגו'. זש"ה לא עשה כן לכל גוי וגו' (תהלים קמז כ), וכן וירם קרן לעמו תהלה לכל חסידיו (שם קמח יד), משל למלך שנשא אשה ראשונה ולא כתב לה כתובה, גירשה ולא כתב לה גט, כך לשניה ולשלישית היה עושה, ולא היה כותב להן לא כתובה ולא גט, (לא עשה אלא) [לזמן] ראה ענייה אחת יתומה בת אבות, ביקש ליטול אותה, אמר לשושבינו אל תנהוג בה כבראשונות, זו בת אבות היא, צנועה היא במעשיה וכשרה, כתוב לה כתובה, באיזה שבוע באיזה שנה, באיזה חדש, בכמה בחדש, באיזה איפרכיא, כשם שכתוב באסתר, ותלקח אסתר אל המלך אחשורוש אל בית מלכותו בחדש העשירי הוא חדש טבת בשנת שבע למלכותו (אסתר ב טז), כך כביכול ברא לדור המבול, ולא כתב אימתי בראן, העבירן מן העולם, ולא כתב אימתי העבירן, אלא ביום הזה נבקעו כל מעיינות תהום רבה וארובות השמים נפתחו (בראשית ז יא), וכן לדור הפלגה, [וכן לסדומיים], וכן למצרים, לא היה כותב להם אימתי נבראו, ולא אימתי מתו, (לא עשה אלא) כיון שעמדו ישראל אמר הקב"ה למשה איני נוהג באלו כאותן הראשונים, אלו בני אבות הן, בני אברהם יצחק ויעקב הן, לפיכך כתוב להם, באיזה חדש, בכמה בחדש, ובאיזו שנה, ובאיזו איפרכיא, באיזה מדינה רוממתי קרנם, ונתתי להם תלוי ראש, לכך נאמר וידבר ה' אל משה במדבר סיני, הרי איפרכיא, באהל מועד הרי המדינה, באיזה שנה בשנה השנית, באיזה חדש בחדש השני, בכמה בחדש באחד לחדש, [לצאתם מארץ מצרים] הרי נכתבה איפטייא, למה שאו את ראש כל עדת בני ישראל וגו', לקיים מה שנאמר לא עשה כן לכל גוי וגו', מה עשה וירם קרן לעמו תהלה לכל חסידיו לבני ישראל עם קרובו הללויה (תהלים קמח יד).