Earlier quoted context omitted.
This is actually a common thing that women experience from men that are trying to passively hit on them. Except most of the time its not from coworkers, so when it does happen in the workplace, its blatantly obvious what the underlying meaning is.
Wow, I had no idea people would interpret this as sexual harassment. I say this to both men and women on my teams that look like they are having a rough day. I'll remove that from things I say. Edit: I don't just say "Smile", usually there is more context to the conversation and usually ends with me trying to see if I can help fix the problem(if it's work related).
If there is no bad intent, why should you? The answer is that a snowflake could get you fired but the rhetorical question stands.