I spend most of my days thinking about this, as someone whose job is effectively community organizing around the (lack) of (safe) public spaces. In my opinion, from a societal POV, two built environment challenges are key impediments: 1) As you mention, a dearth of public spaces to connect with others, especially during times when people are not working, which has made it very challenging to find the spaces to do the important work of community creation, whether that is as "simple" as a knitting circle (one here meets in a Whole Foods, which seems nice until you realize that a Whole Foods or a Starbucks is no substitution for a truly public space that *everyone* has and can feel ownership over) or a group trying to organize to improve their neighborhood. 2) Car culture supremacy (in the US, at least), which means that people drive nearly everywhere. Walking and biking and transit are the forms of movement that lend themselves to spontaneous and key social interactions, but they are least-used, and car supremacy makes them dangerous and unpleasant (or people perceive them that way) in most places. The prevalence of cars spirals outward: our public funds go into highway expansions and endless road maintenance instead of public spaces or art; parents can succumb to the pressure of endlessly packed kids' schedules because driving is "easy" and "fast"; people are frustrated and mad and individualistic as they get behind the windshield; and cars are obscenely expensive, meaning that people are working a great deal to be able to afford them.
How to solve is broad and wide-reaching, but IMO it starts with all of us making a choice. I hear time and again from others who look at my life that it is impossible for them, for any number of reasons. But they look with a sigh of jealousy at my cargo bike and 2-block access to a grocery store with reasonable rent, while telling me that kids "need" a yard. From people who want to make change where they are at but are hesitant to move forward. It is very difficult, but it takes doing things like walking your kid to school one day a week - and if that is too unsafe, starting to raise a stink and organizing with other parents who are also pissed by the lack of a sidewalk or traffic light. It takes doing things like my old roommate did and leaving notes at every house on the block about how she is available to call if they need help or want to connect (out of which she has made a lifelong friendship with someone of a different generation, and made smaller connections with others). It takes looking around at what others are doing that feels impossible and trying it out. It is so hard, but that is where all of the power is, because that is how organizing and demands for better transit, public spaces, whatever all come from.
Sorry, soap box. In terms of solutions, we also need way more organizing trainings - places where average people who care about something can learn how to talk to others about their concerns, how to listen, how to build meeting agendas and make meetings inclusive and dynamic spaces and know when to move urgently and when to pause, how to do things like understand power dynamics and how to understand what has been ripped away from them through our starvation of the collective realm.