Every job I've been at I've formed close friends. My closest friends include people from every job and I don't think it's a coincidence. These friendships are just as real (and I'd argue stronger) than your "real" friends.
Maybe the problem is with you and you are just somebody people don't like? Or you think you shouldn't be making friends at work which is kind of sad.
Should you create life-long bonds with people because of accidents of geography, or because you have chosen to spend your working life doing the same thing? Even the incidental friendships you make at the water cooler with people who just happen to be working in the same company are as valid as the ones you make when you're walking your dog.
Despite this, the weekends are always busy with friends from outside of work. I find it builds a strong community.
For my part, I work for a Silicon Valley company and therefore do have some close friends at my job, I get the best of both worlds.
Over my career I've both worked with people that I've voluntarily kept in touch with after our time together ended (we even occasionally float the idea of jumping ship and going into business together) and people that drove me up the wall who I couldn't wait to get out of my life (as people, not even necessarily that they were unproductive employees, although some of them were). If I could just have less of those forced interactions due to physical proximity, then I'd have more social energy to spend on people I actually want to spend it on.
Actual friendships aren’t monetarily driven.