I don't recall ever being told that myself, but it strikes me as one of those "probably well meant but actually kind of rude" comments, such as "You look tired."
I'd probably be offended if someone told me I need to smile more and, like you, it would NOT make me feel like smiling. Sorry you've heard that comment.