''And the son of the Israelite woman pronounced the [Divine] Name and cursed. So they brought him to Moses. His mother's name was Shelomit the daughter of Dibri, of the tribe of Dan.'' [Emor 24:11]
Why does the Torah ''praise the Jewish people'' at the expense of incriminating Shelomit? [see Rashi]
This could be compared to the principle that if a person does a profound teshuvah, his ''transgressions become for him like merits'' [Yoma 86b]. For since the person's sins made him feel distant from G-d, they were ultimately the inspiration for his return. Thus, retroactively, we perceive them as merits.
So too in the case of Shelomit: when her example inspires other women to behave modestly, her transgression will be rendered retroactively as a merit for her. Therefore, it is publicized here.
Based on Likutei Sichos Vol 37 - Lubavitcher Rebbe