It was after the plague — and Hashem spoke to Moshe and to Elazar the son of Aharon HaKohen, saying, “Take a census of the entire Jewish People . . . (26:1-2)
By instructing Moshe to take a census of the people right after mentioning the plague that killed so many of them, Hashem is compared to a dedicated shepherd who counts his remaining flock after they are slaughtered by a pack of wolves.
One could ask, though, there are two ways to know how many people were killed: one could count the remainder of the people — as we see from our verse; or one could simply count the number of victims. Why did Hashem tell Moshe to count the entire Jewish People in order establish that there were 24,000 victims of the plague, why not just count the victims? Surely, counting 24,000 people instead of over 600,000 would have been a far less arduous task!
Perhaps one could answer that rather on focusing on the negative actions of the Jewish People — namely their sins which brought on the plague — Hashem instead wanted to focus on their virtues — namely that the remainder of the People would merit to enter into Eretz Yisroel. Therefore, despite being a more cumbersome count, the lesson we learn is that even when it is more difficult, it is always better to focus on the good of others instead of their failings.
This message was brought to light in a very beautiful way when Chaim Sher* met his former cheder rebbe at a teacher’s conference. After introducing himself, Chaim told his former teacher that it was because of the following incident that had made him decide to be a cheder rebbe.
In Chaim’s class, there was a wealthy boy who received an expensive watch as a gift. No one had such watches at such a young age, and so, this watch was quite an attraction to his classmates. After everyone’s initial excitement, the boys went to recess and the watch was left on the table… until someone took it. The rebbe was informed that one of the classmates had stolen the watch and when no one volunteered to return it, he told everyone to line up against the wall with their eyes closed and he would check their pockets. Chaim explained that the rebbe checked everyone’s pockets one by one until he came to his, where he immediately found the watch. Chaim was terrified. But nothing happened. A few minutes later the rebbe sat down at his desk with the watch in front of him. No one had seen where the watch had been found and the rebbe announced that the watch had not been “stolen” by a bad boy, rather it had been taken by a good boy who was struggling with his yetzer hara, and no more was said about the incident. Chaim explained that he was still terrified that the rebbe would punish him privately, but when the rebbe never said anything to him, not that day or any other, he realized that he had been saved from severe embarrassment; and said to himself, if this is what it means to be a rebbe, then I want to be one too.
Chaim finished his story and sheepishly said to the rebbe, that rebbe was you. “But please tell me,” asked Chaim “how was it that you never looked at me any differently after you found the watch in my pocket? I never sensed any disappointment or frustration from you. How did you do it?”
His former rebbe looked at Chaim and said, “I never knew it was you, for I too did the search with my eyes closed.”
 This follows Rashi’s first interpretation; in conjunction with the Sifsei Chachamim.
 Bamidbar 25:9.
 Ibid. 25:51.
 See the Chikzuni.
 Related in the name of Rav Shlomo Levenstein.