| Sotah
"In the measure that a person measures so it is measured to him. She [the sotah] adorned her body in order to transgress, God has disgraced her; she exposed her body in order to transgress, God has exposed her. She began the transgression with the thigh and afterwards with the belly; therefore will the thigh be smitten first, and afterwards the belly, and the rest of her body shall not escape" (Sotah 8b). 
Divine justice is not always quick in coming but it is exacting. And so the Mishna lists others who were punished in exactly the same manner in which they sinned. "Shimshon went after his eyes and therefore the Philistines gouged out his eyes...Avshalom gloated over his hair therefore he was hanged by his hair. And because he had relations with the ten concubines of his father, he was pierced by ten spears."
Man must ensure he uses his organs for their intended use - if not we risk having them come back to haunt us. This is the basic theme of tefilat zaka, the beautiful and moving prayer composed by the Chayei Adam, Rabbi Avraham Danzig, some 200 years ago which is said by many before Kol Nidrei. In it we note how we sinned in taking the organs G-d planted within us for a specific purpose and using them for their opposite purposes. We beg G-d not to punish us measure for measure as we resolve to improve. 
Yet thankfully this works both ways. Moreover "the measure (reward) for doing good is always greater than the measure of doing bad" (Sotah 11a). And thus the Mishna lists the great reward received from even relatively small actions. Miriam waited by the riverbank for Moshe for a few moments and merited having the Jewish people wait a full week for her in the desert, "and the nation did not travel until Miriam was gathered with them" (Bamidbar 12:15). This is all the more remarkable when we consider that the reason the people had to wait was because Miriam had spoken ill against her brother and was thereby punished with tzara'at. Even, perhaps especially, when we sin G-d remembers the good we have done. 
The Mishna continues noting how Yosef made the great effort to bury his father in Israel - something not at all a given, explaining why Yaakov asked him to swear that he would do so - and thus merited that while the people were busy leaving Egypt Moshe busied himself by personally going to "take the bones of Yosef with him" (Shemot 13:19). And in that merit Moshe merited to be buried by G-d Himself. Once again we see how our actions - inconsequential as they seem at the time - can have a great impact hundreds of years later. 
Miriam not only waited for Moshe as he floated on the Nile. She was the cause of his being born. "When Pharaoh decreed 'every son that is born you shall cast into the river' (Shemot 1:22), he [Amram] said: In vain do we labour. He arose and divorced his wife.  All [the Israelites] thereupon arose and divorced their wives. His daughter said to him, 'Father, your decree is worse than Pharaoh's; Pharaoh decreed only against the males whereas you decree against the males and females; Pharaoh decreed concerning this world whereas you decreed concerning this world and the World to Come. In the case of the wicked Pharaoh there is a doubt whether his decree will be fulfilled or not, whereas in your case, though you are righteous, it is certain that your decree will be fulfilled...He arose and took his wife back; and they [the people of Israel] all arose and took their wives back" (Sotah 12a).
What is fascinating is that the above midrash follows the description of Pharaoh's plan to eliminate threats to the throne. He initially decreed that the midwives should kill Jewish male newborns - in any which way they desired. When that plan was "ineffective" he decreed and tried to enforce that all Jewish male babies be thrown into the river. Yet even that was not enough. Fearing that someone from his own people would rise against him he decreed that all male babies (it was inconceivable to him that a female could lead a coup) Jewish or Egyptian, be thrown into the river. Pharaoh was willing to destroy his own people to safeguard his rule (how some things never change). While the intent of Amram was much different the effect would have been the same - the wiping out of his own people. How fortunate that Amram had much better advisors than Pharaoh.
But what makes these two stories told back to back truly remarkable is the introduction to the second with the comment that "Amram, the gadol hador, greatest of the generation, was he." That explains why all followed his example and divorced their wives! But does the Gemara really need to introduce the story with this statement. Why not say so before introducing a story of Amram's greatness?

Perhaps the Talmud wants to teach that true leaders are willing to listen to others and change course - even when all have heeded one's original (mistaken) pronouncement so that reversing oneself means admitting one's errors to all (a major theme of  masechet Sotah and one we have addressed on our last two posts 
here and here). True greatness means humbling oneself and listening to the arguments of others. 
Yet at the same time I cannot help but feeling that the Gemara is teaching that it was specifically because he was the leader of the generation that he made such a mistake. That Amram was the gadol hador is part and parcel of the story and not merely an introduction, the kind of which we find nowhere else in the Talmud. 
As a leader one must tend to the needs of the people especially in times of need. One must inspire them, nurture them and comfort them. It is certainly irresponsible to encourage having more babies when death awaits. And perhaps Amram feared that those babies who had managed to be hidden by their parents would be discovered and killed if their mothers would have another baby. Amram acted most responsibly under horrific conditions. 
But Miriam was not a leader of the people, she being a little girl probably no more than four or five. She had the innocence of a child, not yet understanding how cruel people can really be. Her concerns were not the here and now but dreaming of the future, of what she will do when she grows up. She like most children wanted another brother or sister. She saw hope where others saw despair. 
It truly takes a great leader to know when they must use their skills to tend to the people and when they must throw out what they learned as they were being groomed for leadership and act like an uneducated - but most perceptive - child. Having children may not have been the practical or even wise choice but it was the only choice possible.