Internet Legend said:
Exactly. I have had several female friends ask me how I could have guy friends without having sex with them. I asked her why she had sex with all of her male friends. She didn't know. Usually, when I am friends with someone their sex doesn't matter anymore. One of my very very best friends is a guy. We were roommated for several years and physical attraction was never an issue. He's an attractive guy and I love him dearly, it just wasn't an issue. I don't know how he feels about the whole thing, but that is my side of it. He was also in a serious relationship with another close friend of mine and that also played a part in it. I think sometimes she was jealous. I don't know that for sure, but I think she was. Not jealous that she thought he and I were screwing around (she knew he wouldn't do that.... and she knew I wouldn't do that), but I do think she was jealous of the time I spent with him as it was time she wasn't able to spend with him (this was very true when they lived in separate towns and he and I were still roommates). But, fifteen years later, the two of them are married, with kids, and they are still two of my very closest friends.
I have gotten involved with male friends. None of them worked out and I remained friends with some of them. I figure one of the reasons I was attracted to them was because I liked them as people. Sometimes it took me some time to come around to being friends with them, but I usually did. And we were often very good friends to boot. I practically lived with one as he was dating a roommate, and it was perfectly fine.
There are other times when I wouldn't get involved with a friend because I wasn't willing to risk the friendship. Their friendship meant too much to me to ruin that over sex. I still have a few friends where that is true. Even if there is an attraction, I am not willing to risk it because I know it wouldn't be anything more than a fling for either of us and I don't want to ruin an excellent friendship over a fling.
Like Donna said, just because there is an attraction doesn't mean you have to act on it.
And like Ethan said, maturity has a lot to do with it. I think being able to be friends with the opposite sex without having sex is a big sign of maturity.