It's not that there isn't value in having friendly relationships with your colleagues no matter their gender. The issue comes up in comparing the value of a specific relationship with the potential costs of it (or attempting to create it).
Right or wrong, befriending a male colleague has virtually zero risk. The chances of anything happening to severely damage your career or social standing are essentially nil. Even in a severe situation, there isn't much you can do to cause a problem without acting in a pretty horrible way that's also documented. There just isn't much you can do there to really provoke a highly emotional reaction or scare HR.
The same cannot be said of attempting a relationship with a woman. People are very sensitive about sexual harassment and HR wants absolutely nothing to do with it. The exact lines for sexual harassment are necessarily a bit blurry. Even if they existed, continually just barely not crossing them would seem like harassment to me.
Is the friendly relationship with a woman coworker so much more valuable than a man that it is worth taking on additional risk? I don't think so.
I don't intend to have a particularly strong relationship with all my coworkers and I imagine most people are the same. This means I get to be choosy about which ones I engage in this way. The risk-reward ratio just doesn't seem favorable to engaging women in this way.
Now, personally speaking I have slightly more female friends than male friends, unless we're counting people I might talk to once every few years. My oldest friend, by far, is female. I would never suggest men should not be friends with women. That's insane. I'm just not sure what the incentives are for me to try to specifically befriend female coworkers.