Exactly. A good friend wouldn't. That's a comment from someone looking to find a reason to explain their own lack of success. A good friend would congratulate you, regardless of whether you beat them out for the job or not. Sounds like a case of sour grapes to me... and some people don't just have a few, they have entire vineyards. Nothing will ever be their fault, it can't be because the other person was more skilled, or had more more experience, they must have had an unfair advantage. That's easier than taking a hard look at yourself, being honest and addressing the real issues.
A good but insensitive friend. And maybe he was right (though overstated), perhaps being female was an advantage in getting the intership. If she wasn't sensitive, she could have responded, "maybe so, but you had the advantage of being male." And she'd be right.
I see your point, there are likely just as many people who consider being male an advantage, as there are people who consider being female to be an advantage in this situation. The only person(s) who actually knows why she got the internship and he didn't is/are the person(s) making that decision. Frankly I'm more concerned with her self-doubt than I am with his lack of tack. If you aren't going to believe in yourself, why would you expect anyone else to?