Is it always wrong in a work setting? Depends what you mean by work setting. I will occasionally complement my coworkers' (male or female) clothing or haircut if I am pretty close to them and if we are in an informal situation at work (chatting while drinking coffee, meeting in the hall, etc.) I think that is OK (unless one is very persistent in complementing a coworker, makes them uncomfortable, etc.)
But in an actual formal work situation at work, no way, never. If someone were to introduce a colleague at a business meeting as "The top sales rep in the Northeast and also the most attractive" that would be WRONG WRONG WRONG.
I just read that Obama has said similar things about men in professional contexts, so I doubt he is an evil sexist, he was just making dorky jokes. But it is still wrong. Wrong to say about men or women.
I also think it was wrong as he said she was "by far the best looking AG in the US." Isn't that ranking looks?! Did he create a beauty pageant for AGs from the US and he was the judge?!That means the others are not as attractive. Not a smart or sensitive (and a sexist) thing to say which is surprising since he is such a bright guy!