I think it's because you look upset, angry, or even bitchy. I'm guessing it's because you're a pretty girl, and they don't get why you look unhappy. Maybe they seek to help. There's also a chance they've seen you smile before, and think you have a pretty smile, but if it's random stranger probably not so much.
Granted, you don't have to do it, and I can see how it can get annoying. People do that to me all the time too. Still, I think they mean well enough. Especially if this comes from any of your friends family or assorted loved ones. In those cases, do try to be understanding. If it's strangers, feel free to tell them off, or bare minimum ask them what the fuck.