It is classically explained that Miriam received tzaras for what she said about moshe and the reason her punishment was so harsh was being a holy person even a small mistake is magnified to be a bigger deal than if it was someone else.
However, when it comes to the six remembrances each day, “Remember what the L‑rd, your G‑d, did to Miriam on the way, when you went out of Egypt.” The emphasis here is on what G-d did to Miriam and specifically what G-d did to Miriam while we were leaving Egypt.
What is the connection between tzaras and leaving mitzryim?