Valerie Aurora posted a very insightful article about harassment at conferences. She focuses largely on "hacker"/security conferences, like DEFCON, but the general principles apply to all conferences. And I've personally seen related bad behavior (though to a much lesser degree) at conferences I've attended (which have all been based around open source software, not "hacking"/security).
The work that Valerie's Ada Initiative is critically important for the technology industries, which still have a lot of work to do on being inclusive (particularly to women).
As some personal anecdotes, most of the best conferences I've attended have had strict anti-harassment policies/codes of conduct (including Linux.conf.au and GUADEC). They help make the conference a more-welcoming place by clarifying unacceptable behavior, which brings in more participants from a wider variety of backgrounds, which makes the conference better for everyone.
Specifically, GUADEC's and Gnome's work to include more women has really started to pay off. The official count this year was that 17% of the attendees were women, and it was obvious. And it was especially for anyone who's been attending since Vilanova in 2006, like me, where I can honestly only remember a few women attendees. The Gnome Outreach Program for Women certainly deserves a fair amount of credit here, as do the Gnome community's clear and consistent enforcement of the Code of Conduct.
Codes of Conduct/anti-harassment policies/many laws should not be necessary. But they clearly are because some people otherwise don't understand or refuse to comply with common decency. These policies really require a fairly minimal amount of effort to create and enforce, open attendance to a much wider and diverse audience, and benefit everyone as a result. Everyone wins!