Maybe it's just a classic nightmare, or unpleasant dream. You called it that in your subject line. It's true we do dream about our secret fantasies, but we also dream about our fears, the things we would never want to come true.
And sometimes our sleeping brains focus on some random recent event in our lives, and turn it into a dream story for no apparent reason at all. Maybe you heard someone mention sex with a girl, or with this girl you know, or you saw something on TV about straight sex. Or have been reading RJ threads about gay guys here who have had sex with women.
And just like an RJ thread that evolves all out of relationship to the OP, some innocuous event from our daily lives can also morph into a feature billing in our dreams, with a new set of characters chosen for no clear reason.
BTW, when I was still convinced I was straight, I did wonder why I never had any dreams at all about straight sex, like other straight guys all said they did. Then I came out gay, and my dreams were suddenly filled with sex for the first time in my life... gay sex!
So even though I was even married, I've never had a straight sex dream in my life, just gay ones. But as I said, don't overlook the nightmare factor in your case.