If the employee really said
"There is an inappropriate comment there, but I won't make it".
Then what they said is worse than if they had blurted out something stupid about removing a layer of clothing. At least a comment like that has a possible defense of "oh, I never thought of that having a sexual aspect to it." Saying "I know you're not supposed to suggest removing clothes, so I am going to make you think about me suggesting you remove some clothes hur hur hur aren't I funny while at the same time restrained and well behaved" is inexcusable.
As to "how not to do that" you say something like
alluding to misbehaviour is not measurablesignificantly different from misbehaviour. There is not a border or line where you say "I could punch you, but I won't" and that's fine because you didn't punch anyone. Keep your thoughts inside your head and keep your mouth shut unless you need to say something for business purposes.
I might also add
It is possible to have an unexpressed thought
This is a new concept to many people, especially smart and high achieving people. You may literally need to spend some time on it. The customer doesn't need to know that he thought of a really funny comment.
It doesn't matter whether people are too sensitive or not. He's paid to do work on a customer site, and if the customers don't like how he behaves on site, he's not doing his job. If he finds the rules very subtle and nuanced and contradictory, then give him much sterner and simpler variants of the rules. Stick to business. Talk less. No jokes. Humour is for people who are trained in how not to hurt others with it, which he apparently is not. Done.