Why is the section concerning Miriam juxtaposed to the section dealing with the spies?
(13,2) “Send out for yourself men, and they will spy out the land of Canaan which I am giving to the children of Yisrael.”
Rashi brings the question of the Midrash: Why is the section concerning the spies next to the section dealing with Miriam? The Midrash answers: Because she was punished over matters of slander, for she spoke against her brother, and these wicked people (the spies) did not learn the lesson.
Various commentaries have tried to understand the question of the Midrash, because behold, the two events occurred one after the other, and so it is completely natural that they should be written in the Torah next to each other!
But it seems to me that we can explain it according to what is written in the previous parsha, that the prophecy of Eldad and Meidad and the elders happened on the same day that Yisrael gathered the quails, and afterwards they remained there for thirty days which is the “month of days” mentioned in the parsha. After that Miriam was smitten with tzara’as and all of Yisrael waited seven days for her to rejoin the camp, and only then did they travel.
But the problem with this is that since Moshe was told about the prophecy of Eldad and Meidad straight after they prophesized, and immediately afterwards Miriam and Aharon spoke against Moshe, presumably she was smitten with tzara’as on the same day. If so, how could the Torah write in posuk 12:13 that “the people did not travel until Miriam was brought in again” to the camp? Behold, the seven days of seclusion should have finished before the end of the thirty days of the eating of the quails! Perforce, we must say that Hashem waited and did not punish her until after the thirty days had finished. But this itself is problematic - why did Hashem not punish her immediately on the day that she sinned?
This is what the Midrash meant when it asked why the section of the spies was next to the section of Miriam - why did Hashem delay the punishment of Miriam so that these two events occurred next to each other? So that it would be fresh in the minds of the spies so that they could learn a lesson from what happened to Miriam for speaking evil of someone, but these wicked people did not learn the lesson.