>>40980977
Angel Dubs!
Yeah OCD is bundled up with "Intrusive Thoughts". Unlike what social media portrays, intrusive thoughts are not impulsive thoughts. Intrusive thoughts are your brain tricking you showing you things you REALLY don't want. Thoughts that generate so much anxiety, your brain can't let go (because of how OCD works in your frontal lobe and all). It's terrible, but you must remind yourself that this isn't what you want. You also can't fight these thoughts, you kinda have to let them go by like a wave (easier said than done). A good call to differentiate OCD from other mental conditions is that people with OCD know their OCD compulsions aren't "real". They know locking the door X times won't alter how their day goes, but it eases the anxiety so they do it. In some other conditions they'll believe that if they don't go through with it, the neighbors who've been spying on him will take it as a sign to stab their dog.
>>40980968
Could be some sort of trauma. But the self doubt about, specifically, being a bad person does sound like something you'd see from OCD or some other anxiety disorder. As others have said you should probably talk to a shrink about it if it's impairing your life.
I have a hard time saying that IT IS OCD because I find it hard that it would've taken you this long to notice it (afaik you start seeing signs by early Teenage years), but who knows.
Wish you the best my friend.