It took courage to write what you did about the incident...know that you are loved and accepted by many good people here, in heaven and in your family.
You asked why has this happened. The first reason is that you experienced a trauma that happened in the past. The trauma was powerful enough to damage the nervous system. From that point onward, the physical pain and unconscious energies remained in your subconscious mind.
Whenever you meet a new male, you remember and associate the pain you experienced with your ex-boyfriend and then disaster sets in and you reject him and run away. Psychology calls this the "fight or flight" mode.
The next part is to find the willingness to understand more about this within yourself, feel compassion for others and then make a game plan to heal your body, mind, heart and soul... on all levels.