I can suggest possible reasons for such behavior. It's important to remember that these are only speculations and not definitive explanations for your particular situation.
Professional courtesy: Some doctors, including dermatologists, might offer compliments as a way to make patients feel more at ease or comfortable during a vulnerable moment like being undressed for a medical examination. The intention could be to create a friendly and supportive atmosphere.
Social awkwardness: Medical professionals are humans too, and some may display social awkwardness in certain situations. The repeated compliments might be an awkward attempt to engage in conversation or diffuse any discomfort they may perceive in the situation.
Genuine appreciation: The dermatologist might genuinely find something they admire about you, such as your appearance or style. Complimenting a patient might be their way of acknowledging what they see positively.
Misinterpretation: It's also possible that you are misinterpreting the situation, and the dermatologist's comments were unrelated to your state of undress. They may have simply been expressing a general compliment or being friendly without any ulterior motives.
Regardless of the dermatologist's intention, if their behavior made you feel uncomfortable or uneasy, it's essential to trust your instincts and consider discussing the matter with them. You can express your concerns openly, and they should address them professionally and respectfully. If you feel uncomfortable discussing this directly with the dermatologist, consider speaking with the clinic or hospital's management about your experience. Patient comfort and well-being are critical in medical settings, and your feedback can help improve the overall patient experience.