You don’t have to be happy to smile, you just smile to be happy.
It’s a say towards unforgiving situation. Sometime a situation can be just sad or just negative and people just don’t know how to react to it. For whatever the condition is, the quote simply just implying the importance of finding all the small values of a negative situation and accept it for what it’s worth. And always smile, not a fake smile you do when you try not to give bad impression towards a certain moment. But smile because you accept the moment is just as it is.