Men and women can be "just friends," if she's pretty
It sounds crazy, but hear me out. Everything I've ever heard on the difficulty of males and females staying "just friends" has focused on the guy's threat to the friendship's stability: deep down, he registers her as a girl who he hasn't fucked yet, and at some point he'll make an awkward move on her, thus endangering or ending the friendship.
But what about the girl's threat to the friendship's stability -- she treats him as a surrogate doormat boyfriend, and a guy with any balls at all won't stand for this, so he is likely to stop investing in her as a friend. *
Her boyfriend doesn't listen to her problems? She runs to the friend. Her boyfriend doesn't cook for her? Her friend does. Her boyfriend doesn't do sweet, romantic things for her? She'll try to get the friend to do them. She also flakes out on plans with her friend, uses him to get attention and validation, and similar things that she should only be able to get away with if he were her boyfriend.
And although the guy and girl are trying to manipulate each other, the girl can be quite successful, while the guy gets only blue balls in return. If you've forgotten what this is like, just rewind to your friendships with girls during high school and college.
The rational thing for the guy to do would be to just "dump" his female friends -- but what if they could do something for him? She may not want to satisfy his libidinous needs directly, but she could assist him in meeting these needs through other females. That's why it only pays to have attractive female friends: by being seen with them, especially when they are relaxed and having fun around him, he demonstrates higher value to the female onlookers, who he can then easily approach. If she is particularly ballsy, she may even act as his wingman.
He will still have to listen to her problems, drive her places, and inflate her ego, but he can put up with it because he's getting something in return.
Because each party enjoys benefits that they could not provide by themselves or get from members of the same sex, we have a simple case of specializing in comparative advantage that leads to mutually beneficial trade. For once, the guy has a rational incentive not to try to escalate the friendship sexually -- his trading partner would cut off relations, and he'd have to search for quite awhile to find a suitable replacement, starving in the meantime.
In terms of satisfying his sexual needs, the pretty female friend is worth more to him as a broadcaster of value and/or wingman than as a single notch on his belt. She is like a gunsmith supplying a warlord: he will conquer many other tribes with the weaponry she provides, but he'll leave her untouched since he would have a much weaker offense without her. And since he will always be out on conquests, she will have a stable source of revenue.
Also like a gunsmith, she can supply many warlords (although there is probably a natural saturation level), so that below the saturation level, access to the gunsmith is not a zero-sum game for the warlords, preventing potential conflict among the superpowers. The only trouble that could arise is if the warlords wanted to conquer the same tribe, but we live in a world with so many defenseless areas that they can amicably agree on who gets to enslave whom.
Clearly, if the female friend cannot perform this role, he should not be friends with her. That would mean doing all the dopey things she expects her real or non-existent boyfriend to do, tolerating her flakey behavior, inflating her ego with attention, and so on -- without receiving anything in return. Sure, she could provide company, be a conversation partner to discuss shared interests, an activity partner, etc., but a guy could do these things too, and wouldn't flake, complain at length about men, and so on. Indeed, it's more likely that a guy will share his interests, activities, etc. What would she bring to the friendship as a female?
It seems a bit cruel, but let's get real: friendship with members of the opposite sex is not an inalienable human right. If attractive girls get to have guy friends while the ugly ones don't, then that's just tough luck.
* If you call out a female friend for this type of manipulative nonsense, her self-deception kicks in and she will defend her righteousness loudly. However, it is as believable as a guy showing moral indignation when his female friend accuses him of physical impropriety -- hey, he only wrapped his arm around her lower back "just to make her feel safe" while walking.