Indeed, I suspect this is also a large part of the harassment women face in the STEM fields, where such things are alleged to happen frequently. In truth, guys pretty much do this to each other too, though admittedly they may focus a bit more on the one obviously different person in the group (e.g. the one female present). It should be remembered that this is sometimes how we bond, including how we at times bond with coworkers (light hazing).
I can't explain it either, but it does seem to me that the disruption of this particular bonding behavior is one consequence (intended or otherwise) of an integrated workforce. Certainly it is a consequence of the disappearance of mens' space (e.g. the increasing forbidden-ness of any men-only clubs or establishments).