Rashi writes (25:1) that it was Bilam who advised Moav that the Jewish people would be susceptible to the temptation of znus and instigated this form of attack.
What elicited this comment of Rashi?
Mizrachi explains that we find in general that Bnei Yisrael were careful not to engage in znus. Rashi in parshas Emor (24:11) writes that the Torah reveals the identity of the mekalel's mother because she was the only one in Mitzrayim who was mizaneh. Rashi in next week's parsha (26:5) again writes that while the Egyptians were able to enslave us and force us to work, they were unable to force our women into having any relationship with them. So how suddenly did things fall apart in this episode with Bnos Moav? It must be that there was some outside influence that pushed Moav at us -- namely, the plot of Bilam.
Gur Aryeh adds that Rashi's comment may have been prompted by a textual issue. The Torah specifies that it was the "bnos Moav" who were mizaneh. If this was a case of simple lust, then any / all women should have been involved -- not only the bnos. It must be that what happened was not the result of normal temptation alone, but rather was a deliberate plot -- the bnos alone were directed to purposefully go out to Bnei Yisrael and instigate trouble.
The two approaches may reflect a larger methodological question. Does Rashi comment only when there is a particular textual point that needs explanation, or is Rashi interested in larger issues like motivation, morals, etc. that have to do with the story as a whole?
Be that as it may, al pi pashtus perhaps one might say that in Mitzrayim the relationship of master to slave that existed between the Egyptians and Bnei Yisrael served as a deterrent to znus, at least any that might have been initiated by a Jew. For a lowly slave to dream of having a relationship with beyond their social station would have been unthinkable. However, fast forward 40 years and in our parsha we are speaking about a Bnei Yisrael that is a free nation, a people that has flexed it's muscles against Sichon and Og and can compete with anyone. Under those circumstances, the temptation to become involved in illicit relationships with members of other nations, now seen as peers on the world stage, is far more dangerous.
The lesson for our times is obvious.