The way your question is phrased makes it seem like the fact that Moshe and Aharon died via "kiss" originates from the Talmud, while the fact that Miriam died via "kiss" and that it would be improper to write this are Rashi's own additions. In fact all of this is in the Talmud, so to whatever extent you have a question it is on the Talmud not on Rashi.
Bava Batra 17a
תנו רבנן ששה לא שלט בהן מלאך המות ואלו הן אברהם יצחק ויעקב משה אהרן
ומרים אברהם יצחק ויעקב דכתיב בהו בכל מכל כל משה אהרן ומרים דכתיב בהו
על פי ה' והא מרים לא כתיב בה על פי ה' אמר ר"א מרים נמי בנשיקה מתה
דאתיא שם שם ממשה ומפני מה לא נאמר בה על פי ה' שגנאי הדבר לומר
Our Rabbis taught: Six there were over whom the Angel of Death had no
dominion, namely, Abraham, Isaac and Jacob, Moses, Aaron and Miriam.
Abraham, Isaac and Jacob we know because it is written in connection
with them, in all, of all, all; Moses, Aaron and Miriam because it is
written in connection with them [that they died] By the mouth of the
Lord. But the words ‘by the month of the Lord’ are not used in
connection with [the death of] Miriam? — R. Eleazar said: Miriam also
died by a kiss, as we learn from the use of the word ‘there’ [in
connection both with her death] and with that of Moses. And why is it
not said of her that [she died] by the month1 of the Lord? — Because
such an expression would be disrespectful. (Soncino translation)
While the Talmud does not state what the disrespect is, there are parallel versions of this teaching in other Midrashic sources. In one of them, it explicitly states that the disrespect is to use the term when speaking of a woman:
Yalkut Shimoni Parshat Chayei Sarah
ששה לא שלט בהן מלאך המות אברהם יצחק ויעקב דכתיב בהו בכל מכל כל משה
אהרן ומרים דכתיב בהו ע"פ ה' ומרים אע"ג דלא כתיב בה אתיא שם שם ממשה
ומפני מה לא נאמר בה שגנאי הדבר לומר אצל אשה
Similarly, in the version recorded in Yalkut Midrashei Teiman (on the pasuk of Miriam's death) there is no mention of disrespect but it states that the reason why the Torah doesn't say "by the mouth of God" buy Miriam is that she was a woman:
שלשה מתו בנשיקה משה ואהרן ומרים נאמר במשה על פי ה' שנאמר וימת שם משה
עבד ה' ונאמר באהרן על פי ה' שנאמר וימת אהרן שם בהר ההר ונאמר במרים
ותמת שם מרים ותקבר שם [ומפני שהיא אשה] לא נאמר בה על פי ה
Rambam, too, assumes the disrespectful aspect is that Miriam was a woman:
Guide for the Perplexed 3:51
Our Sages said that the same was the case with Miriam; but the phrase
"by the mouth of the Lord" is not employed, because it was not
considered appropriate to use these words in the description of her
death as she was a female. (Friedlander translation)
R. Yosef Chaim of Baghdad explains this explicitly:
Ben Yehoyada Bava Batra 17a
ועם כל זה לא נקיט כן להדיא במרים דאף על גב דהוא דרך משל ודמיון עם כל
זה גנאי הדבר למנקט לשון זה של נשיקת פה בנקבה
And all this notwithstanding, it does not use this [terminology] explicitly by
Miriam because even though it is metaphorical it is still degrading to
use the terminology of a mouth-kiss by a woman.
It seems that the "disrespect" is the association of the erotic connotation of kissing a woman with God. That is to say that it is not the erotic connotation of kissing a woman on it's own that is deemed inappropriate for the Torah to discuss; indeed, R. Chaim Hirschensohn notes that the Torah had no problem describing Yaakov kissing Rachel:
Nimukei Rashi 4:381
אם שהנשיקה בעצמה איננה נגד נימוס הכבוד דכתיב וישק יעקב לרחל אבל לזכור
על פי ה' איננו דרך כבוד
Rather it is the association of God with the eroticness that is inappropriate.
Similarly, Shir Hashirim is replete with eroticness but it is not problematic because the eroticness is not associated with God (in the text).
1. This is clearly a typo, and should say "mouth". It appears with the word as "month" in the PDF (linked) but I don't know how it appears in the original printed volume.