When a census of Bnai Yisrael is taken, the Pasuk says that each man shall give a ransom for himself to Hashem in order to avoid a plague (Shemot 30:12). Seforno says that when a group is counted, the counting is a sign that this group is undergoing a change and requires constant inspection. This change is the result of sin; therefore, this tally must be accompanied by atonement.
Rabbeinu Bachya has a different approach. He says that this tally draws out the individuality of the people, establishing them as separate units independently watched over by Hashem. Therefore, any plague will affect an individual more severely than it would affect him if he were just a part of the greater whole.
The Sefer Hachinuch views the census as Hashem’s method of creating equality within the nation. He says that in order to maintain Bnai Yisrael’s welfare and increase their merit, Hashem gave each person, rich or poor, an equal share in this Mitzva.
In singling out individuals from a group, a census creates division where there was once unity, so atonement is necessary. Why was a half-Shekel chosen for this purpose? According to Chassidic literature, the half-Shekel teaches us that no Jew can be complete without other Jews, that one Jew alone is only part of what he can become with others.
According to the Chatam Sofer in his Rosh Hashana sermons, this is what Hashem taught Moshe: Moshe knew that when a community is divided into separate groups, conflict arises. Hashem commanded Moshe to take this census to unite Bnai Yisrael.