Yeah, this blows my mind as well. Believe it or not, people are actually able to make meaningful friendships outside of work. For example, I got into whitewater kayaking after about two years into my career (software) at age 27. It's an activity that requires groups of people to work together. You need multiple people to run vehicle shuttles up/down the river, and you also need multiple people for safety on the river. I've been doing this activity for a few years now, and through it I have formed some of the deepest relationships I've ever had. I hang out with these people every week often on weeknights after work. One of the good friends I met through this activity even got ordained and married my wife and I!
My point is that kayaking is just one means of meeting people and forming relationships. The idea that an office is one of our only opportunities to make relationships is just absurd. My experience with relationships in office is that most of the time they are very hollow and superficial. Also, if most of your relationships come from the office and your career, you are limiting yourself to a narrower field of ideas. If the main people you hang around are managers and software developers, then you are going to miss out on a lot of other viewpoints. Through kayaking, I've made close friends with people from all walks of life. We were out to eat one night at a restaurant, and at our table sat a plumber, a realtor, an orthopedic surgeon, an electrical engineer, and an FBI agent!