Our Gemara on amud aleph tells us that a husband who commits sins cannot expect the waters of Sotah to work. He only has the right to make such moral demands on her if his own behavior is free of sin.
דְּאִי אִית בֵּיהּ עָוֹן בָּדְקִי לֵיהּ מַיָּא כִּי אִית בֵּיהּ עָוֹן בְּדִידֵיהּ מִי בָּדְקִי לַהּ מַיָּא לְדִידַהּ וְהָא תַּנְיָא וְנִקָּה הָאִישׁ מֵעָוֹן וְהָאִשָּׁה הַהִיא תִּשָּׂא אֶת עֲוֹנָהּ בִּזְמַן שֶׁהָאִישׁ מְנוּקֶּה מֵעָוֹן הַמַּיִם בּוֹדְקִין אֶת אִשְׁתּוֹ אֵין הָאִישׁ מְנוּקֶּה מֵעָוֹן אֵין הַמַּיִם בּוֹדְקִין אֶת אִשְׁתּוֹ
that if he has committed a similar iniquity the water evaluates his actions, this is difficult, as in a case where he has committed a similar iniquity does the water even evaluate her fidelity? But isn’t it taught in a baraita that the verse: “And the man shall be clear from iniquity, and that woman shall bear her iniquity” (Numbers 5:31), indicates that only when the man is clear of iniquity does the water evaluate the fidelity of his wife, but if the man is not clear of iniquity the water does not evaluate the fidelity of his wife?
What is the sin that the husband must be clean from? Rashi says, it is limited to having been intimate with her after she was secluded with another man, which he is forbidden to do until after she drinks the water. However, Rambam Laws of Sotah (2:8) says he must be free from all sexual sin, even rabbinic sins, such as being sexual while betrothed prior to Nisuin.
This Rambam is remarkable. How can a rabbinic sin disqualify the couple from the ritual, when the miraculous effect comes from the Torah? From the Torah’s perspective there was no sin. Of course the simple answer is that the rabbinic enactments have the full force of the Torah, even on a mystical level. However, we still need to explain how this is so, and why. Maharal (Be’er Hagolah 1:1:7-8) explains that rabbinic enactments are often based on Torah concerns, they just were not ratified as law. Maharal gives the example of washing hands, which the rabbis use an asmachta from the verse (Vayikra 15:11), “and his hands were not rinsed in water…” (see Chulin 106a) as a basis for the requirement to wash hands. Maharal says that the Torah identifies hands in regard to impurity even though the law in that verse was applying to all parts of the body. The Torah is showing that hands in particular have a strong susceptibility to contacting impure states. Thus, this was Torah concern, but it was not activated into a specific binding law until the rabbis felt it necessary. Consider this, do you think that Moshe Rabbenu picked up a pen or a tool on Shabbos? Do you think that he did melachos with a shinuy? I believe it is unlikely that Moshe and his generation understood the sanctity of Shabbos and naturally avoided secular and mundane contact on Shabbos. They did not need to formalize it into a particular stricture as they adhered to the broad Torah concern of Oneg Shabbos. However, at a certain point in time, the rabbis found it necessary to enact specific prohibitions, presumably because people lost the natural sensitivity to the sanctity of Shabbos and needed more concrete guidelines.
Similarly, we can say the Rambam would argue that immodesty and promiscuity are Torah concerns, even if there isn't a specific violation on the books, so to speak. Thus, even though the man was only sexually violating various so-called rabbinic laws, he was behaving in a promiscuous way. Torah law does not give him the moral high ground to impose the Sotah process on his wife when he is promiscuous.