This is kind of an American way of thinking. Small talk with strangers is weird in many places.
If you're a woman spurning it can get ugly fast (you are not obligated to a reply from a stranger). It's not at all unusual for a woman to ignore small talk from a male stranger and instantly be met with vitriol. I've been in situations where an ignored comment like "smile honey" is instantly met with "bitch". If this is the cost of small talk, it isn't worth it.
There's also the newfound respect for mental health, some people are extremely anxious or agoraphobic, and attempting small talk with strangers in places where people are required to be (grocery, fuel, etc) seems unnecessary. Is complementing someone's hat really worth the potential anxiety? not remotely.
If you're lonely and want to meet people, don't try to do it via small talk with strangers. Join a club, take a class, volunteer. Go to places where interaction is expected, do not foist it upon strangers just trying to go about their daily lives.
If you must small talk, please do not take it personally if someone ignores you.