As explained in this NYT article, it was to teach a lesson about the problem of men sexually harassing women. Here's the public service ad produced:
"These particular ads came about after UN Women and the Mexican government took open submissions for ideas on a campaign to target a male audience. Around 40 agencies submitted pitches and J. Walter Thompson won." (I used to work for J. Walter Thompson — back in the 1970s.)
There's a second ad, taking aim at the asses of unsuspecting male citizens:
ADDED, next morning: Let me be explicit about my objection to this. The government — attempting to fight sexual harassment — is engaging in sexual harassment.