"Come I shall advise you what this people will do to your people" (Bamidbar 24:14). What advice is Bilaam referring to? Rashi explains that he's informing Balak that the G-d of Israel hates licentiousness, therefore if you want to succeed then cause them to stumble in this area.
Bilaam understood what unfortunately many do not understand - what causes Hashem to hide His countenance from us? The hester panim comes from Am Yisrael's involvement in illicit relations and improper keeping of boundaries in this area. many fool themselves into thinking that they are protected against the yetzer hara - there is no one for whom we can't say: "there's no guardian against illicit relations", many greats of the world have fallen to the conniving trap of the yetzer hara in this area.
The Gemara (Kiddushin 81a) relates to us an interesting story involving Rav Amram HaChassid. There was a group of women recently freed from captivity and taken to stay in the attic of Rav Amram HaChassid. The ladder leading up to there was removed so that no one could go up to them.
One of them passed by the skylight and Rav Amram, through the reflection, was able to see her incredible beauty. Rav Amram then picked up a heavy ladder, one that even ten people couldn't lift, took it and set it down to be able to go up to the attic. He began walking up the ladder, at the halfway point he stood still in his tracks and shouted that there was a fire in Rav Amram's house. His goal was to alert the neighbors to come, this would embarrass him and he would then be unable to continue up to the attic. One of the Sages present said to him: "you're embarrassing us". He responded - better that you bring me to shame in this world rather than be ashamed of me in the Next World.
We must understand that the yetzer hara isn't trying to cause us to sink to a low level all at once. Rather it convinces us - today you do this, tomorrow that, and slowly but surely we sink to the level of sin. This means we must avoid seeing things we shouldn't be seeing, including going to mixed beaches and pools, slowly but surely this could result in terrible infractions.
There's a pasuk in our parsha: "Behold it is a nation that will dwell in solitude and not be reckoned among the nations" ("Bamidbar 23:9). The Netziv explains that when Bnei Yisrael live in solitude, meaning they protect their honor with lives of tznius and not mixing with the other nations, then they "will dwell" - they will have attained a place of honor. However, if they want to act like "the nations", with all their licentiousness and immorality and improper dress, then "they will not be reckoned" - they will not be considered anything of significance.
We must therefore understand that if a Jew wants Hakadosh Baruch Hu to walk among us, to protect us, to help us succeed in life, then it's incumbent upon us to guard the sanctity of the Jewish home - to evict the "goyim" from witin us and not to bring the yetzer hara of immorality to entire our homes.
This means we must careful of what we see and what we touch, and be especially protective of anything holy. We will then merit the blessing of: "vehaya machanecha kadosh".