Thanks for your insights on age discrimination issues and housing experiences. That said, there can be communities of all ages that are vibrant spaces to be in -- and which also have places within that are gathering spots (e.g. libraries, cafes, bars, workplaces, churches, non-profit organizations, sports leagues, etc.) for people with something in common (whether age or interests or work or whatever). And I'm not just saying that because I am mid-fifties. :-)

Also, while young people obviously do like to hang out with similar-aged people for all sorts of reasons (including to find romantic partners), there also is value in encountering a diversity of experiences. When I was in college, informal interactions with older people, whether RAs, grad students, older returning students, staff, and faculty (outside classes) provided many formative experiences. And likewise, interactions with younger people (like tutoring a faculty member's kid) provide opportunities for personal growth through teaching, coaching, and mentoring.

Even at college, how many people can the typical person get to know or have as friends or romantic partners? How many friends and romantic partners does a typical person need to be relatively happy? What does it take to provide those opportunities?

Many people 100 years ago used to find that in cities perhaps (especially walkable low-rise ones like Philadelphia) -- but cities have changed for many reasons (including ones Jane Jacobs wrote about). Still, even now, many people flock to some cities for social connection opportunities. (Even as they may later in life flock elsewhere to raise families for various reasons...)

I am not saying most of the cities we have now in the USA are ideal for making social connections -- especially compared to many older European cities that are more walkable and were built with people in mind and not cars. Places favored by some religious communities (e.g. Squirrel Hill in Pittsburgh where Mr. Fred Rogers really lived in a real neighborhood) may sometime be more community-promoting given, say, for observant Jews a cultural need to walk to a social hub one day a week which affects the urban layout generally in a positive way. In that sense, perhaps the Protestant Mr. Rogers benefited from neighborhood architecture shaped in part by Jewish traditions? Searching on "walkshed" can turn up some interesting results, for example: https://www.walkscore.com/cities-and-neighborhoods/

Potentially a good aspect of social media is it may (paradoxically) help people find local people with similar interests to arrange physical gatherings. But arranged gatherings are not the same as spontaneous repeated meetings in common areas -- which has been the basis of the formation of most friendships. Still, one can ask how all that could be made better.

Consider, for the bigger picture, the intersection of architecture, culture, and friendships:
"How our housing choices make adult friendships more difficult" by David Roberts
https://www.vox.com/2015/10/28/9622920/housing-adult-friends...
"Our ability to form and maintain friendships is shaped in crucial ways by the physical spaces in which we live. "Land use," as it's rather aridly known, shapes behavior and sociality. And in America we have settled on patterns of land use that might as well have been designed to prevent spontaneous encounters, the kind out of which rich social ties are built. ...
For the vast majority of Homo sapiens' history, we lived in small, nomadic bands. The tribe, not the nuclear family, was the primary unit. We lived among others of various ages, to which we were tied by generations of kinship and alliance, throughout our lives. Those are the circumstances in which our biological and neural equipment evolved. It's only been comparatively recently (about 10,000 years ago) that we developed agriculture and started living in semi-permanent communities, more recently still that were thrown into cities, crammed up against people we barely know, and more recently still that we bounced out of cities and into suburbs. So everything about how we live now is "unnatural," at least in terms of the scope of human history. Unnatural doesn't necessarily mean bad — our long lifespans are unnatural too — but it should remind us that the particular socially constructed living patterns common today have shallow roots. There's nothing fated or inevitable about each of us living in our own separate nuclear-family castles, with our own little faux-estate lawns, getting in a car to go anywhere, never seeing friends unless we make an effort to schedule it. ...
As external conditions change, it becomes tougher to meet the three conditions that sociologists since the 1950s have considered crucial to making close friends: proximity; repeated, unplanned interactions; and a setting that encourages people to let their guard down and confide in each other, said Rebecca G. Adams, a professor of sociology and gerontology at the University of North Carolina at Greensboro. This is why so many people meet their lifelong friends in college, she added. ...
This kind of spontaneous social mixing doesn't disappear in post-collegiate life. We bond with co-workers, especially in those scrappy early jobs, and the people who share our rented homes and apartments. But when we marry and start a family, we are pushed, by custom, policy, and expectation, to move into our own houses. And when we have kids, we find ourselves tied to those houses. ...
Say you're a family with children and you don't regularly attend church (as is increasingly common). There are basically two ways to have regular, spontaneous encounters with people. Both are rare in America. One is living in a real place, a walkable area with lots of shared public spaces, around which one can move relatively safely and effectively without a car. It seems like a simple thing, but such places are rare even in the cities where they exist. ... Walkable communities are very difficult to find in the US, and because there is such paucity of supply relative to demand, they are expensive, accessible only to the high-income. Places where they exist tend to have absurd zoning restrictions that prevent growing them. ...
The second, even more rare, is some form of co-housing. ... The idea behind baugruppen, and co-housing generally, is that it's nice to live in an extended community, to have people to rely on beyond family. It's nice to have bustling shared spaces where you can run into people you know without planning it beforehand. It's nice to have nearby friends for your kids, places where they can play safely, and other adults who can share kid-tending duties....
Both these alternatives — walkable communities and co-housing — sound exotic to American ears. Thanks to shifting baselines, most Americans only know single-family dwellings and auto-dependent land use. They cannot even articulate what they are missing and often misidentify the solution as more or different private consumption.
But I do not think we should just accept that when we marry and start families, we atomize, and our friendships, like our taste in music, freeze where they were when we were young and single. We shouldn't just accept a way of living that makes interactions with neighbors and friends a burden that requires special planning. We should recognize that by shrinking our network of strong social ties to our immediate families, we lose something important to our health and social identities, with the predictable result that we are ridden with anxiety and loneliness. We are meant to have tribes, to be among people who know us and care about us. ..."

At first glance, sure, it may seem to make sense to ask how can we recreate the college social experience for people 18-22 without the high price of "University". But a deeper question is perhaps: how can we have a culture and architecture that promotes friendships? While also still having access to natural settings that are also improve mental health?

Here is a quote about an even deeper aspect of all that related to depression (which can strike people even in the "best" college where social needs are perhaps met -- but others might be neglected like getting enough sleep, omega3-s, sunshine & vitamin D, exercise, downtime & creativity-provoking-boredom, purpose, and so on): https://tlc.ku.edu/
"We were never designed for the sedentary, indoor, sleep-deprived, socially-isolated, fast-food-laden, frenetic pace of modern life. (Stephen Ilardi, PhD)"

So, an even deeper and more general question is: how can we have a culture and architecture and economy that promotes life-long wellness and happiness?