Society cannot gift you friends…
It sort of can! Think about a very-religious church group or a military squad. When people are forced to spend all their time with a small group, they mostly become friends.
In the not-very-distant past, we lived in much smaller communities with much more interdependence.
I think some of the "male loneliness" talk is because society used to literally gift men with a friend group and a family and now they need to get all these things on their own but a lot of boys have not been raised to develop the skills they need for this new society.