However, in the same social setting, when a man compliments a woman's appearance, the implied meaning is "I am pursuing you romantically." And this is fine in social settings, otherwise our species would die off.
But it's not fine in the work place. You feel that a woman at work giving you such a compliment is "harmless fun" because if it was a normal social situation, you would have the power: it's up to you to pursue. But for many women it is not "harmless fun" because it's similar to the social situation, and they feel romantically pursued, which is not okay at work.
[1] Please note I do not consider this a promise, so let's not confuse this with "asking for it." Human communication is subtle, and such implications are how consensual "courtship" happen. Of course, once there is a rejection, whatever implications one thought were there don't matter.