Now, yes it may be a compliment, but it is an unwelcome one because it does two things. First, it puts her on the spot. How do you respond to that in an appropriate and professional manner? What if they are straight up inappropriate? [1]. What if they are addressing another person in the room and not you directly? ("Wow doc, you have such pretty ladies taking care of me here!"). This is an extremely uncomfortable position to be in, and one that most men never experience.
Second, this diminishes her professional qualities. With more or less clarity, lots of these men say things like "you are so pretty, do you even know any medicine?". Some basically, say that straight up.
And the biggest problem with all this? These are incidental occurrences. If your boss pinches your bottom every day, you go to HR, complain and your boss gets to take sexual harassment training or gets fired. When patients make you uncomfortable, it's always a question of whether it's worth it to try to correct their behavior at the risk of being unprofessional. Remember, the patient can easily complain that you were rude to them. Make a habit of it, and like it or not but your job will be affected. This is especially bad since most of the people that make these comments don't even realize that they are making her uncomfortable, so to call them out on it would be even more of a shock.
[1] One particularly bad incident was when she asked a patient about his sexual function and he responded with "Well if you were my girlfriend, I wouldn't have any issues, trust me."