Why was a census needed in Iyar if Hashem had already brought His Divine Presence to dwell amongst them in Nissan?
(1,1) “And Hashem spoke to Moshe in the wilderness of Sinai in the Tent of Meeting, on the first of the second month in the second year of their going out from the land of Egypt, saying.”
Rashi explains that when Hashem was about to bring His Divine Presence to dwell amongst them, He counted them. On the first of Nissan the Mishkan was erected, and on the first of Iyar He counted them.
But on the same day that the Mishkan was erected Hashem already brought His Divine Presence there, as it says in parshas Shemini! So what was the point of this counting which took place in Iyar?
The answer is that a count is not needed when Hashem wishes to reveal His Divine Presence temporarily, but when He wishes it to dwell permanently amongst Yisrael then a count is required (the Kli Yakar explains that the word 'dwell' implies permanence. See there also for an explanation why a count is needed in order for the Divine Presence to dwell amongst Yisrael). And less than thirty days is not considered a permanent dwelling as we see from the gemora in Bava Basra 8a, which teaches that the minimum time required to be considered an inhabitant of a city is thirty days.
Therefore, on the first of Iyar, thirty days from when Hashem’s Divine Presence began to dwell there, a count was needed.
How does the Torah compensate for what might be perceived as a slight to the honour of Shimon and Menashe?
(1,22) “For the tribe of Shimon, their descendants according to their families, according to their fathers’ houses, his count (פקדיו) according to the number of names, according to their head count, every male from twenty years old and upward, all who go out to war.”
There are quite a few differences found in several places in this parsha - in the section dealing with the counting of the tribes, in the section of the order of the flags, and in the section of the counting of the Levi’im and their order, but there are two differences which particularly need explaining - with regard to Shimon and with regards to Menashe. When the Torah discusses the counting of the tribe of Shimon it writes an extra word - פקדיו, but not when discussing the counting of any other tribe. And when discussing the positions of the tribes according to their flags the Torah writes concerning Menashe “ועליו מטה מנשה” (and next to him was the tribe of Menashe) instead of writing “והחונים עליו” (and encamped next to him) like it does with the other tribes who were encamped next to the head of the flag.
But the reason for these two differences is because out of all the tribes, only with Shimon and Menashe do we find a point of apparent inferiority with respect to an older brother - Shimon’s younger brother Yehudah was the head of his flag group, but Shimon was not the head of his, and Menashe was second to the head of his flag group, his younger brother Ephraim.
Therefore, to compensate for this the Torah made some changes to show their seniority. With Shimon it wrote an extra expression of counting - with all the other tribes it writes only פקדיהם, but with Shimon it writes both פקדיו and פקדיהם. And because of this even though Yehudah and his flag group travelled by Hashem’s command in first place at the head of Yisrael, when writing about the counting of the tribes the flag group of the tribe of Reuven is enumerated before the tribe of Yehudah because of the honour of Shimon, so that he will have a point of superiority over Yehudah because he is older than him. And therefore all of the flag group is enumerated first, even the tribe of Gad.
And with Menashe, although he was secondary to the head of the flag, Ephraim, the Torah did not want to write והחונים עליו because that would imply that Menashe was completely secondary to Ephraim. Instead it wrote ועליו מטה מנשה, which means "and next to him" but which also means "and above him".
Why were the Levi’im counted from the age of one month?
(3,15) “Take a count of the children of Levi, according to their fathers’ houses, according to their families. Every male from the age of one month old and upward you shall count them.”
Rashi explains that the reason why they were counted at a much earlier age than the rest of Yisrael was because this tribe were accustomed to be counted from the womb. This is the explanation on the level of Derash, but the simple explanation is because the Levi’im were given in service to Hashem in place of the firstborns, and since firstborns are redeemed from the age of one month, they too were counted from the age of one month.