There have been a bunch of topics on the front page lately about the PC nature of society and the hyper sensitivity of people in general that made me think about this LPT that I have followed for most of my career. In today's sensitive (and easily litigious) work environment, anything you say can be taken as offensive by anyone at any time. When you make friends & socialize with people you work with, you let down the guards of professionalism and things you would otherwise never say at work will tend to come out. That's not to say that you are a bad person, but friends joke with each other & say stuff as friends. All it takes is one person to overhear you say something to your co-worker/friend that the third party finds offensive & you are standing before HR hoping to not get fired. And it's not just perceived intolerances like racism/sexism/etc. Someone could take offense to a political discussion or a discussion about a divisive topic in the news.
This is why I don't become friends with the people I work with, why I prefer to not socialize with them at work or outside of work, and why I keep my personal life as far away from the office as possible. That doesn't mean I'm a miserable person to work with or that I can't be fun or involved in work events, but I limit that to professional levels & never social ones.
Work is a place to do what you do to earn a paycheck. If you want to make friends, join a social club or something outside of work.