I might also start thinking about finding somewhere else to work. not running away, but as a positive upwards step.
You had a complaint about co-workers messing about with a female doll that made orgasm noises. If I had made that complaint, in my organization, disciplinary proceedings would have occurred against those co-workers, there would have been sexual harassment training for those involved and possibly termination of contracts. In fact I would have kick-started the proceedings, I am a senior manager.
You are not making a fuss about nothing, and instead of acting on your valid complaints, they blamed you for "making them look bad". This company doesn't deserve female employees. I suggest you take them for all the training you can and then take your considerable brain and talents to a company that values you.
This is completely outside of the issues with your ex, but given the two together, if you have choices, I'd start to look at exercising them.