A few quotes from the Rabbi on 'Traditions of the Fathers'
in which he teaches the Torah innovation that the deaths of righteous women atone.
"Why was the section on the death of Miriam in the Torah juxtaposed to one on the Red Heifer? To tell you that just as the red heifer atones, so do the deaths of righteous women atone." The rabbi [named] Tirat Kesseph, of blessed memory, wrote: Would it not have been enough to say, 'Why was the [section on the] death of Aaron juxtaposed to [the one on] the priestly garments' to inform you that just as the priestly garments atone, so do the deaths of righteous men atone, since it does, in fact, say that the deaths of righteous men and sages atone? But what basis is there to say that the deaths of righteous women can atone? Women are not the same, for how can women merit this great thing, since they are not obligated to [study] Scripture and Talmud, even when they are righteous...? Miriam's death, therefore, was juxtaposed to the section on the Red Heifer to teach us something new, that the deaths of righteous women atone also, as does the red heifer. The Torah innovates, saying that the red heifer, which is also female, atones. Our masters, of blessed memory, saw the Midrash and wondered, in these words: "What reason is there for all the sacrifices to be male, and for this one to be female? Rabbi Ibo said: An allegory to a handmaiden…" In this way the heifer comes to atone on the [golden] calf affair. It is indeed astonishing in their eyes that there are only male sacrifices and no female ones. The heifer, however, despite its being female, does atone. Here the Torah also teaches us something new, through the juxtaposition of Miriam's death to the Red Heifer.
Yoseph Hen, Sermon D on the Upright and Wise Person, p. 38, Abraham Teshuva Press, Tripoli, 1928