Well, I can understand why some people don't like receiving passive-aggressive (unsolicited) comments or "backhanded compliments" from strangers.
However, from what you've described, your interaction with him sounds like it was completely friendly and good-natured on your part. Even if he didn't want to verbally engage in conversation, that guy could have at least smiled at you, or given you a little nod, or (at worst) just said nothing...but there was no need for him to scoff at you and embarrass you like that.