Even worse, it's quite possible for discrimination to become a disincentive to recommending someone, just like incompetence would be. Someone who won't be well-received for personal reasons is effectively a "bad candidate" with the potential to damage the recommender's reputation. The result is that even a person who overcomes barriers to find network connections won't necessarily be able to draw on them effectively.
(A past-tense example to cut down on politics: a Liar's Poker trader wouldn't recommend a friend who couldn't sell, but they also wouldn't recommend a skilled trader who wasn't a friend. And if they had recommended a skilled friend who wasn't a white guy, they could have expected at least as negative a reaction as if they'd recommended a bad trader.)
In my experience friendly or not, people tend to be quite honest when vouching or generally asked an opinion on someone.
Referring a bad candidate (or an incompetent one) will damage your reputation/credibility, and most people don't want that.