Men are not puppies, asshole.
You're right: men are not puppies. They're human beings who are capable of owning their actions and changing their behavior if it is unacceptable. I would also say that someone so fundamentally damaged as to be unable to restrain sexist or racist behaviors is not a valuable employee regardless of technical skill or contribution--but unable is not the same thing as unwilling, and I have a hunch that those who are actually "unable" are few.
Give me a fucking break.
Calling out negative behavior tends to be very effective.
If however you are interested in treating the cause, then I suggest you listen to what yelsgib has to say.
I'm saying that in this particular case a lot of the "negative behavior" stems from extreme internal pressures.
Programing or any place in the world isn't some special place for poorly socialized men to hang out and ... what... hide? You know what would be good? Learning social rules and improving. Them maybe his life wouldn't suck and he could get a date. And you know what would help that? Being forced into social situations with women and being slapped when he steps out of line.
If you have a puppy and it pees on the floor, you don't feel sorry for it and lock it in the house so it can pee on the floor forever, you train it not to.
If we "just give up" on these men and leave them alone they will be miserable forever. If they are forced to learn (at a later age, you know what, all the rest of us learned this a long time ago) they maybe they can get on with their lives and not be miserable.