I have plenty of friends outside of work. I work for a living and I'm a professional doing a job, not a kid on a play date.
The cynic in me always felt that people who emphasize this benefit of office work just can't make friends unless people are forced to hang out with them every day.
That being said, there's lots of meetups, clubs, organized sports etc etc for people looking for a structured way to continuously hang out with a group of people sharing their interests. The key thing there is that it's voluntary association though.
Being forced to hang out with coworkers who you might not even like just because they happen to have the same employer shouldn't be a substitute for putting in an effort to make friends.
There are some social spaces I try to go to regularly but the people who turn up are not always the same. A lot of the time I'll manage to connect with one person, which is hard for me, and then I will never see them again even if I keep going to the same event. Or I see them about once every couple of months at the event. Or on the one day I'm going to the event my energy levels are low and I feel overstimulated by the novel environment and I don't manage to really speak to people. Putting myself out there a lot to new people in new places is something that I find stressful because I have been rejected and made fun of for trying to connect with people for the majority of my life. Honestly, i always had an issue with this, but I became better at being sociable in uni. Being in my house most of my time has brought my XP down and I find that the more I am stuck inside the more I regress in my abilities. I find it really hard to leave the house once I become unaccustomed to it. My brain just starts to break down.
I think a sports team might be the most consistent spaces but I'm pretty dyspraxic and when I do team sports I end up getting anxious and like hitting my team members in the face. I can't do that sort of thing.
What works for me is having a consistent space where I can slowly build up relationships with people over time. This is sort of how things have worked for the whole of human history. Work, school, uni, sports teams. This is where people make most of their friends. Always has been, always will be. And again, if I have to be working for most of my waking hours, I don't want to do it alone in my little box. It's not enjoyable. And saying that I must meet all of my social needs from concerted effort outside of work on top of all the other responsibilities I have is insane to me.
When I have a workplace that i know i can go into and see people a couple times a week, my mental health and energy levels are better and my social XP is stronger and I can actually enjoy socialising. Last year i was mostly remote, this year I've found a company with compulsory 2-3 days a week and lots of other young people. Its amazing. I finally feel okay. And yeah if I was working somewhere where I hated everyone and I didn't get any benefits other than money I would LEAVE. Don't stay at a place like that. Your mental health is too valuable and work should enhance your life otherwise you're literally ruining 80% of your waking moments.
Edit: on the point of leaving, yes i know some people have kids and can't move around like that. but this is why i'm pro mandatory hybrid not 100% in office. workplaces should be okay with you needing to stay home when your kids need sth or you coming 2 days if you live past a certain distance instead of 3 days. My office accomodates this. I come in 3, others come in 2 because they have long commutes. Everyone is fine with it. 100% wfh just punishes anyone who doesn't have kids.