I'm sorry this happened to you.
I have all sorts of compulsions similar to what you describe. In my case, though, I have no idea why I have them or what triggered them. I say I'm perhaps transgender. But, really, I have no idea. Sometimes I think my gender-related issues were simply one aspect of a broader mental health problem that went unrecognized and untreated. Now it's too late to worry about any of it. I just do what I have to to keep my head above water, so to speak. Best wishes...