The book of Bamidbar opens with the instruction to make a national census. Following the lead of a number of Torah commentaries, we take the opportunity to discuss the important question of if and how a population census can be conducted.
Although the prohibition of counting people does not appear in the Shulchan Aruch, Rambam, ((Hilchos Temidim U-Musafim 4:4.)) followed by a number of prominent authorities (including Magen Avraham, ((Orach Chayim 156:2.)) Pri Chadash, ((Orach Chayim 55:1.)) Kaf ha-Chayim, ((Kaf ha-Chayim 13:10.)) an others), record the prohibition of counting a group of Jews.
The Sources
The most elemental source for the prohibition of counting the nation is found in Parashas Ki-Tissa, where Moshe is instructed to count the people by collecting a half-shekel from each person. As the pasuk writes, this is in order "that there be no plague among them ((See Rabbeini Bachya, Shemos 30:12, who explains that the act of counting singles out each member of the nation as an individual, separating him from the Divine providence that protects the nation as a whole.)) when you number them." ((Shemos 30:12.))
Based on the explicit verse, the Gemara in Berachos states that the prohibition of counting is elementary, such that even schoolchildren are aware of it. Nonetheless, King David erred in this matter, and counted the nation, with dire consequences. The Gemara quotes Hashem's forewarning of the tragic event: "Behold I will make you stumble over a matter which even schoolchildren know, namely, that which is written, 'When you take the sum of the children of Israel according to their number, then shall they give every man a ransom for his soul to Hashem [that there be no plague among them].''' ((Berachos 62b.))
Authorities discuss whether counting transgresses a Torah prohibition or not—on the one hand, a Torah verse is involved, yet on the other, we do not find the prohibition mentioned in the lists of mitzvos compiled by rishonim. ((See the Hebrew article on din.com for Parashas Ki-Tissa, which deals with this question.)) It is further noteworthy that the Gemara elsewhere, ((Yoma 22a.)) which addresses the count of priests officiating in the Temple, quotes different sources (from Scripture) in establishing a prohibition against a numerical survey of Jews. Specifically, the Gemara mentions the census taken by King Shaul prior to his campaign against Nachash of Ammon, and later in advance of the war against Amalek, which he conducted by means of donations. ((I Shmuel 11:8, 15:4.))
Several approaches are offered for why these different sources are required, ((The Gemara in Yoma adds a further source from Hoshea 2:1.)) some of which include important halachic ramifications. ((See Tzitz Eliezer, Vol. VII, no. 3, where the various approaches are outlined; see also the article in Hebrew (on din.com) for Parashas Ki Tissa.)) With regard to taking a census, however, the principle discussion of authorities revolves around the error made by King David in counting the nation. Following in their footsteps, we will focus our discussion on King David's perplexing mistake.
King David's Error
As noted above, the Gemara in Berachos states that King David's mistake was considered elementary even for schoolchildren. Indeed, we find that Yo'av, David's military general and a great Torah scholar in his own right, fiercely protested the census: "Why does my lord require this thing? Why will he be a cause of trespass to Israel?" ((Divrei Hayamim 21:3.))
Yo'av was correct in opposing the undertaking of a census, as the pasuk continues to record: "And G-d was displeased with this thing; therefore He smote Israel"; ((I Divrei Hayamim 21:7.)) "So Hashem sent a pestilence upon Israel from the morning even to the time appointed; and there died of the people from Dan to Beersheba 70,000 men". ((II Shmuel 24:15)) David himself conceded his guilt saying, "I have sinned greatly in what I have done ... for I have done very foolishly.” ((II Shmuel 24:10; I Divrei Hayamim 21:8.))
Yet, neither the verses nor the Gemara mention what the nature of David's mistake was. In the opinion of Be'er Sheva, David's error was caused by Hashem hiding the truth from him, and there is no cause for further investigation into the matter. ((Commentary to Tamid (Chap. 1).)) However, biblical commentators have not adopted this simplistic approach, and have advanced a variety of explanations for the error. We will focus on three explanations, all of which are given by Ramban.
1. In his commentary on Shemos, Ramban explains that David erred in believing that the prohibition of counting the nation applied only during the period of wandering in the wilderness, and lapsed upon entry into the Promised Land.
According to this interpretation, David's census was conducted directly (on account of his misunderstanding the eternal nature of the prohibition), which is why he transgressed the prohibition and brought a plague upon the nation. ((This is implied by the Gemara, Berachos 62b.)) An indirect count, by means of half-shekels or a similar expedient, is thus permitted. This is also the position of Rambam. ((Hilchos Temidim U-Musafim 4:4.))