Hello Bostie: I'm sorry you are having this difficulty. I don't know that I have any particularly useful advice for you. Yes, this was a most unfortunate incident. But, then, your supposed friend's reaction was really over-the-top too I think. Now she no longer has you for a friend & you don't have her. So all are punished here.
I'm not very skilled when it comes to handling interpersonal conflict. I'm a pretty-much completely solitary old man. My inclination in a situation like this would be, if you see her at the gym, just do what you can to avoid her. My perspective would be that nothing positive is likely to come out of trying to apologize once again or explain once again why it is you do this sort of thing. The more you struggle to make this right, the more entangled you are likely to become. At least this is the way I see it. If she tries to accost you & make a scene calmly tell her you regret what you did & you have apologized, that's all you can do. Then just walk away. This becomes a matter of boundaries. Yes you did something inappropriate & unfortunate. You recognize that. But this does not give this woman carte blanche to beat you up at every opportunity.
You know, I imagine that we all have thoughts we're not particularly proud of or comfortable with. I certainly have more than my share. When they arise, I strive to accept them with lovingkindness & compassion. They are like misshapen little trolls. But they have no power over me beyond what I cede them. The important thing is that you recognize your thoughts for what they are & you're working on them. What more can one expect? I wish you well...