Because she had a thing for him. There was just something about him that called to her, something that made her wish there was hope for the two of them somehow. Hope for what? She wasn't quite sure. And deep in her heart, she feared she would never get over him... Even after she was safe and he left.
And yet, she had honestly meant what she said to him, that she knew that nothing could ever happen between them.
Nothing was ever going to come out of their time together. She accepted that. She had no expectations concerning him. So she was going to go home and cry out her eyes. She wasn't going to throw away her pride and dignity and do something crazy like beg him to stay or get into a relationship with her.
So, yes. It had been rather a bad idea to have sex with him. A bad idea that had turned out absolutely perfect. Something beautiful and real and honest in the middle of a terrible mess. She probably should regret it. But she didn’t.