“And they fell on their faces and said, ‘G-d, O’ the G-d of spirits and all flesh, if one man sins, will You be angry with the entire congregation?’” (16:22)
The Ohr HaChaim seeks to understand the meaning behind this title for Hashem. What does “the G-d of spirits and all flesh” mean? The Ohr HaChaim explains that Moshe used this title for Hashem for two reasons:
First, Moshe emphasized that while alive in this world in the flesh, we have a spirit that allows us to think for ourselves, make decisions and decide whether or not to accept Hashem as ruler over us. This use of the word ruach meaning making a thought-out decision is found, for example, in Yechezkel 20:32 where the pasuk uses the term ola al ruchachem, meaning “if the matter enters your mind”.
Even though the true divine judgment should be to destroy them immediately for their wickedness, nevertheless, if Hashem were to destroy the entire congregation for the sins of one man they would use their judgment and make up their minds to reject as their ruler a G-d Who acts this way.
Second, this title is the highest form of praise with which we can praise the Creator, because the lowest praise is that of the Heavenly hosts. The next highest form of praise is received from the souls of the Tzaddikim both from those who were not yet born into this world and still live in the supernal chamber called the guf (Yevomos 62a) and higher praise from the neshomos of the Tzaddikim who had already been in this world and whose souls had now returned back to Otzar HaChaim. They all sing and praise Hashem and Hashem acknowledges their praise, as it says in Mishlei 16:4, “Hashem made everything for His praise”.
The highest form of praise and song, says the Ohr HaChaim, comes, however, from those souls who are alive right now, down here in this world, in physical bodies. This is because the flesh prevents us from perceiving Hashem and forces us to exert effort to love Hashem and sing His praises. This avoda is the most cherished and beloved to Hashem above all else precisely because of the effort involved, as is explained at length in the words of Chazal and in Sefer HaZohar.
This is why Moshe wisely chose this title for Hashem when he praised Hashem and called Him “G-d of spirits of all flesh”, meaning “G-d of the spirits that live now in the flesh”. You, Hashem, desire that they recognize You and praise You despite the difficulties and hindrances. It is therefore wrong to judge them and punish them because they will reject Your G-dly rulership over the spirits of these neshomos who are clothed right now living in the flesh and fulfilling Your desire.