Interesting question. I've seen this before in women in technology spaces. I am a member of one mailing list/chat community in particular that has faced many of these issues.
As the community was developed, it turned out it became a positive environment for beginners, advanced users, technophobes, and technophiles alike. Somewhere along the line, the community gained a reputation for positive, encouraging answers, that were also technically accurate and thoughtful. The community never excluded men, and over time, the male to female ratio on many of the mailing lists was debatable.
At several points in time, men on these mailing lists began to dominate conversation and answer many of the questions. A lot of the women on the lists fell back into "old habits" -- not answering questions, being afraid to be shot down, that kind of thing. Some of the men answered questions in very direct (not disrespectful necessarily, but matter-of-factly) tones, which served to turn a lot of the women off. One solution was to politely ask the men to respect the womens' space and the objectives of the community in general, which worked to an extent. Most of the men participating didn't even realise what they were doing, and were shocked to find out how it was received.
Another solution that was very accomodating to the "locker room" sort of mentality was to also create a womens-only sub-space for the community. This is a forum where only women are allowed. Of course it's difficult to enforce over the internet (as others have mentioned), but it did serve as an area where if a man was discovered ("outed") he was not welcome. Some women refused to participate, but it seemed to be a "best of both worlds" sort of thing. One issue faced here was transgendered/transexual people, and it was decided that gender identity (how a person identifies themselves) took precendence over biological identity (a person's physical sex). To me that's the only reasonable course of action, but it was debated -- some people see someone who is physically male but identified female as male, and no argument will change their mind.
I have participated in other strictly women-only communities where men are absolutely not allowed. While it is discriminatory, the argument for this is that most communities are male-dominated, and having a women-only community is to restore the balance by biasing heavily (exclusively) in the other direction. It would be awesome if we were able to discuss all issues in the presence of any gender without discrimination, but the unfortunate reality of our time is that we're just not there yet. Even when we do get there, it may still be nice to have gender/sex-centric issues (men don't have periods and women don't have prostates), but the exclusion of other gender/sexes may just not be necessary or realistic.
I don't mind the male presence, but we should keep the charter of this forum in mind: womens cycling and related issues. If this forum becomes male-dominated, we will have to deal with it, but in the meantime, one or two polite and helpful men aren't going to kill us.
</soapbox>