Another interpretation of "Number every firstborn male" (Numbers 3:40). This is what Scripture says: "There are sixty queens and eighty concubines, and maidens without number; one alone is my dove, my perfect one" (Song of Songs 6:8-9). A parable: It is like a certain merchant who had stones of glass, and he would bring them out to the market. He did not pay attention to their number, for he did not bring them out by count, and when he came in to put them away he did not put them away by count, because they were of glass; he did not give heed to them. But he had a single string of fine pearls, and this one he would take and bring out by count and put away by count. So too, as it were, the Holy One, blessed be He, said regarding the nations of the world: I have not given them a number, because they are not regarded as anything before Me, as it is said, "All the nations are as nothing before Him; they are counted by Him as less than nothing and emptiness" (Isaiah 40:17). But as for you, you are My children, as it is said, "Who have been borne by Me from the belly, carried from the womb" (Isaiah 46:3). Therefore I number you at every hour. Therefore it is said, "Number every firstborn male." Thus, "There are sixty queens [... and maidens without number]; one alone is my dove, my perfect one" — these are Israel.
Why God Counts Israel but Leaves the Nations Unnumbered
Midrash Tanchuma Buber, Bamidbar 23:1
ד"א פקוד כל בכור זכר. זש"ה ששים המה מלכות ושמנים פילגשים ועלמות אין מספר אחת היא יונתי תמתי וגו' (שה"ש ו ח ט), משל לאחד פרגמטוט שהיה לו אבנים של זכוכית, והיה מוציאן לשוק, ולא היה מבחין במניינם, שלא היה מוציאם במנין, ונכנס להניחו ולא היה מניחן במנין, לפי שהיו של זכוכית, לא היה משגיח עליהן, והיה לו ליניה אחת של מרגליות נאות, והיה נוטלה ומוציאה במנין ומניחה במנין, כך כביכול אמר הקב"ה לאומות העולם לא נתתי להם מנין, לפי שאינן חשובין לפני כלום, שנאמר כל הגוים כאין נגדו מאפס ותוהו נחשבו לו (ישעיה מ יז), אבל אתם, בניי אתם, שנאמר העמוסים מני בטן הנשואים מני רחם (שם מו ג), לכך אני מונה אתכם בכל שעה, לכך נאמר פקוד כל בכור זכר, הוי ששים המה מלכות [וגו' ועלמות אין מספר] אחת היא יונתי תמתי, אלו ישראל.