My closest friend (apart from my husband) is bisexual and makes no bones about the fact that if it weren’t for her religious belief and my invincible straightness, she’d have launched a full-scale epic attempt to get into my pants years ago. She also makes it totally clear that of the two things, it’s the latter that’s the more serious bar.
Now, given that scenario, am I expected to break off our friendship for the health of my marriage?
The friendship predates the marriage by some 8 years (and has weathered with grace and verve law school, living in different states for 9 of the 11 years we’ve been best friends, her marriage and subsequent divorce, near-death experiences, her passionate rededication to her faith (which I do not share), life-threatening illness, and various and sundry other slings and arrows of outrageous fortune. It’s fair to say that the relationship I have with my best friend is as important to me as the relationship I share with my mother and more important than the relationship I have with my siblings.
It’s safe to say that at one point at least, she had romantic inclinations in my general direction. It’s also safe to say that if I were to suddenly have a revelation in which I alter my sexual orientation to swing more to the distaff, I might have similar inclinations in her general direction. I still wouldn’t leave my husband for her - I already have romantic inclinations in his direction 
She possesses precisely the same danger to my relationship as a male friend to whom I am not attracted.
In other words, no danger at all. The danger to the marriage would be my behavior. If I chose to behave in a manner that threatened my marriage - i.e. if I gave intimacy to someone other than my husband that should be his exclusive province as my husband - then that is my behavior that’s problematic. Has nothing to do with the gender of my friends. What it has to do with is my choice of the person to whom I form and maintain the bond of trust and intimacy that are foundational to any marriage.
That being said, people who pretend that being friends with your preferred gender is no different than being friends with people not your preferred gender are smoking crack. You can be close friends with someone and not betray your marriage or be in danger of infidelity, but you have to take extra care to avoid it. Avoiding couples sorts of activities with your preferred-gender friend is a good plan, lots of group outings, making sure your spouse is always invited, never doing anything you wouldn’t want your spouse there fore, etc.