Rashi wants to know why. He says that God needed to know.
In a modern context we would say that such information is important for the government, to assist them to calculate how many soldiers they can raise in time of war, and to allow them to work out what health, education and other facilities the population might require.
The top priority in God’s mind, says Rashi, is rather different. Because of God’s love for the Israelites, Rashi explains, He counts them on a regular basis.
Every individual is precious. Every individual counts. Nobody is a nobody. If a person feels depressed, alienated and insignificant, God says, “But in My eyes you are a jewel. To Me you matter. My world cannot continue without you.”
Somebody once said, “Idiots must be important to God – otherwise why did He create so many of them?”
The Torah point of view is that no-one is without virtues and value. No-one is written off as far as God is concerned.
The Mishnah makes it quite clear: “Man is duty-bound to say, ‘For my sake was the world created” (Sanh. 37a). God decided that there was a task which only I, or only you, or only anyone, can carry out. He needs us in His world to carry out that task. When we feel down in the dumps, we have to remember that.
It would do us all good to read Chapter 3 of Abraham Joshua Heschel’s book, “Who is Man?” (1965).
Note that Heschel does not ask, “What is man?” That would imply that man is a thing, a pawn, a conglomerate. His question is “Who is Man?” Man is unique, precious, sacred.
God numbers His creatures and savours every one.