I have not had my surgery yet so I have not encountered this. It is unfortunate but true, why do people feel the need to talk about something with someone and give their two cents? I say if you do not agree with my choice to do surgery keep your mouth closed. We do not have to talk about it. I am a grown woman and this is my decision to improve my life and nobody has to agree with it but me. If I made my decisions based off everyone else I would never be happy, I would be making them happy. I have become a bit "assertive" in the last few years (I work in an ER) and I would have probably said something about how inappropriate the joke was and in the future I would appreciate them not sharing. If it is the workplace it should make them nervous because if you were to go to HR they would have to address it. I refuse to tolerate stuff like that, especially at work. People at work will occasionally talk about someone because of their weight and I always say, "man I hate to hear what you say about me when I am gone?" My own passive aggressive way to deal with them and make them think about what they say.
It has been my experience that people feel the need to give their two cents when it is not asked or appreciated. I am assertive enough at work that they realize real quick I am not going to tolerate it. You are right on when you say that people will always find ways to judge people. I am not sure if that is driven from their own low self-esteem or just ignorance but if you deal with it in the passive aggressive way it will constantly remind them that you are not going to take it. If that does not work just get assertive and tell them that in the future they can keep all jokes to themselves, you are not interested in their personal opinions and that the jokes are not appreciated. If you do not say something to stop them, in their head they have the green light to share these "jokes" with you all the time.