And Miriam is always called plain: אֲחוֹתוֹ sister of Moshe. She was a true sister, who was the cause of Moshe’s very existence. And: וַתֵתַצַב אֲחוֹתוֹ מֵרָח וֹק ב ד she stood from afar to watch what would happen to him. She remained his loyal sister and was worried about him when he was in the: תֵ יבָ ה basket in the Nile River. And surely she was being a caring sister when she complained that he was neglecting his wife; this was clearly L'shem Shamayim and for his benefit.
R' Yosef Leib Bloch Zatzal says that the reason why Yosef spoke Lashon Hara about his brothers was because he wanted them to become great like he was. We learn from Miriam and Yosef that even if you’re L'shem Shamayim, beware of criticizing others.
STORY
There was a major family Machlokes, and 4 men and 4 women from the family came to see R' Matisyahu Salomon Zatzal. He said that nobody should tell another to make sure to do what he’s supposed to do! Normally, this is viewed as criticism and causes Machlokes. You do what YOU have to do, and learn to be: סוֹבֵ ל tolerate other people who aren’t as perfect as you want them to be. But no giving Mussar to others!