Honestly, I've heard this a lot, but I moved from a suburby area to one of the densest cities in the country and IME, people who feel this way are people who haven't really tried saying hello. I make eye contact with strangers and say hello pretty often, and I never really get anything but smiles and friendly replies in response. The same thing applies to chatting to people when waiting in line or whatever, etc. This isn't just a bubble thing, because I live in a pretty grubby area but also socialize in a lot of swankier areas, and I've found it to be pretty universally true.
TL;DR: You get out of a community what you put into it.
I didn't even notice it until I moved when people would actually make eye contact, talk, and be polite. You still pass people with their headphones in and eyes down... but they're not the majority in the smaller, less crowded city.
In the suburbs, neighbors are often (not always!) super friendly. My neighbors and I have watched each others' pets and helped each other in a lot of ways.
I think it's just the "buying" versus "renting" thing. In the city most people are renting. There's less incentive to make friends with your neighbors when in the medium-term future one or both of you will probably be somewhere else. Your rented property is truly often just a place to keep your stuff. I think rental neighbors should still try to be friends for a variety of reasons (why wouldn't you want to get along with and help your neighbors?) but this is a minority opinion.
On the other hand, when you and your neighbors are all in the midst of 30-year mortgages, people often put more effort into getting along and forging bonds. More of a "we're all in this together, let's try to get along" thing. One of our next-door neighbors is actually kind of unfriendly.
In my immediate area, there are folks who know me by face//habits//&c. The neighbours, the comic shop folks, the owner//operators of area restaurants, and so forth... I may not know them on a deep level, but we encounter each other on a semi-regular basis and have a measure of quality in our contact which we both enjoy.
Medium-for-its-purpose type of deal.
I moved out of the big city to a smaller one and was instantly fascinated by people who would say, "Hi," as I passed by. At first it made the hairs on the back of my neck stand up. They would even stop and ask how I was doing and make a banal, funny comment about the weather. The culture of the city I just came from was different. People would assume you wanted something if you opened your mouth or looked at anything but the ground a few meters in front of you. For more than a decade I lived in a place where people weren't nice to you unless they were selling something.
I even tried Facebook for a while because my friends had all stopped using the phone. That was a disaster. You would think that going to an "event," with all of your "friends," would be great. But people only showed up with their cliques and there was nothing very friendly about it. I stopped using Facebook and deleted my profile. I stopped going to events where nobody would talk to me and ended up seeing precisely the same people I would hang out with anyway so no loss there. I think the "social network," thing is some kind of inside joke I don't understand.
I hope to get to know my neighbors better. I shovel the snow the for lady on the corner. She lives alone with her dog. Her husband suffers from dementia and lives in a home. The neighbors one door up are a large family that mostly keeps to themselves. The grandmother is the only one who will acknowledge my existence when I say, "Hi," while I'm out in the garden or when we bump into one another at the corner store. It's weird, I think, to feel like I'm living in a fish bowl and that my community is just a place where we all keep our stuff and sleep.
It must be this pervasive culture of convenience and luxury that allows us to be entertained and socialized without having to interact with anyone else. Who knows what your neighbors are like and who needs them? Maybe that is a better quality of life. I just think it's a little strange... and when hard times do come I wonder if we'll all be able to rely on one another to get through it.