"And the people did not journey," etc. Because Miriam waited when [Moses] was cast into the river, as it is said, "And his sister stood afar off" (Exodus 2:4), therefore the Holy One, blessed be He, repaid her: that the Ark of the Holiness and the clouds of glory waited for her, for the cloud did not go up from over the Tabernacle until she was healed from her leprosy. Just as she did not stir from guarding her brother until he was saved, behold — measure for measure.
Why Israel Waited Seven Days for Miriam Outside the Camp
Midrash Aggadah, Numbers 12:15
והעם לא נסע וגו'. לפי שמרים המתינה כשהושלך ביאור, שנאמר ותתצב אחותו מרחוק (שמות ב ד), לכך פרע הקב"ה לה, שארון הקודש וענני הכבוד המתינו לה, עד שלא נעלה הענן מעל המשכן, עד שניצולה מצרעתה, כשם שהיא לא זזה מלשמור אחיה עד שניצל, הרי מדה כנגד מדה: