Speaking of my parents, my mother brought me up to always be a gentleman around ladies, which included things like not using bad language. This was quickly drilled out of me when I entered the real world.
Dave Chappelle has an amusing stand-up routine about this subject called "Chivalry is dead, and women killed it"
Did you misread the bit about "holding the door open for a lady"? Hint: the reason he does so is not because of her gender, has nothing to do with "being a gentleman" or anything else your parents taught you that you're dragging into this thread before anyone else did. The reason I know is because he calls it a "common courtesy" in a "similar light" to his position on being respectful with your language regardless of the gender of your listeners, and disavows one sexist justification for holding the door for women specifically. He probably brought up the door thing because some people have the idea that women are offended by having a man hold a door for them, precisely because it used to be chivalrous. And a counter-meme is that few real women are like that, so who knows, but this swearing anecdote seems a point in favor of the first idea. Did you see that he used the word "lady" and your chivalry detectors flared up and refuse to take anything else he says at face value? Was the comment edited after your reply? I was there around that time and it seems unlikely.
Since I had to dig a bit to justify it above, I can understand how you've misinterpreted it. The comment may have been sloppily written, or has a certain subtle sense of humor/sarcasm/analogy, or maybe even trolling by appearing sexist but being technically not.. but if you read it carefully and maybe a bit charitably I really believe it means pretty much the opposite of what you thought.
You probably still hold back on some "bad language" to men and women you don't know well, or you wouldn't call it "bad language." That was the main point.
At least that's the main point of GP's post. What the guy in the story was thinking is debatable I guess, but I don't see much point since we can't know.