I remember reading that the word "scruple" comes from the meaning "sharp stone" and scrupulosity is like a sharp stone in your shoe, paining you with every step. Scrupulousness can be a form of OCD, with a sensitive conscience constantly jabbed by fears of committing sins, doing something wrong, making a mistake or being negligent. Scrupulosity means never feeling forgiven, redeemed or having any lasting relief from confession(if one is Catholic), or constant fear of eating something not Kosher(if one is Jewish), or fear of breaking the law, being dishonest, or unjust(whether religious or secular).
Compulsions could include repeated confession, constant checking to make sure items are Kosher, repetitive prayers, or rituals that seemingly have nothing to do with what you fear, but give you a brief relief from the fear. For me, going to church generated whirlwinds of questions, and sucked up my energy, and filled me with despair. I went to a very liberal church, and ruminated on whether I was going to hell because I believed being gay wasn't a sin, or that women could be ministers. I was afraid that my decision to go to this church was a mistake, even though in my heart, I couldn't go to any other church.
And of course, there are people who would say that really God was trying to get me to repent, that I really was making a mistake, that it wasn't OCD at all. This is where faith comes in, the faith to believe what I know in my heart, in spite of the intrusive thoughts, and the collusion of some preachers and teachers with what my OCD is saying. I also suffered from fears of being a bad person, outside of any particular theology. An excellent article is Scrupulosity: Blackmailed by OCD in the Name of God by Laurie Krauth, who describes this type of fear:
Some people—religious and not—experience scrupulosity as an irrational moral perfectionism. I’ve heard them describe the fear of getting “in trouble” for making a non-existent or unlikely error for which they would be punished. A businessman obsessed about having told a colleague that he had read a book when in fact he had skimmed one of the chapters, and agonized over how to clarify “the truth” to his colleague.There is part of me that knows God is bigger than my OCD fears. There is part of me that knows I have intrinsic worth by virtue of being human.