Hello Aaron, welcome to the forums, and thanks to those above who have replied with some excellent comments.
What you have said Aaron and if I can just rephrase this slightly 'whenever I did a sin I would have to do a ritual that was difficult to do', whether this is about lust or some other obsession/compulsion can quite easily happen, and yes, it did with me, where I had to swallow 100 times as a young kid, this was absolutely exhausting and I never completed it because for some reason I was interrupted and then I had to start from 1 once again, sounds ridiculous if I ever had to mention this to another person, so I never did and finally gave up and did something else.
That's exactly what I told myself and felt relieved by saying 'I'll do this instead' that was able to compensate and satisfy my OCD, swallowing 100 times was an enormous task that physically no one could achieve, especially in a certain time slot and I did this when I was just a youngster.
So replace this ritual and know that everyone is allowed to imagine whatever, it's just those with OCD, it sticks around, but you are allowed to imagine another thought because with this illness our obsessions/compulsions may happen at one particular house, but as soon as you move to another residence then there is no reason why you have to carry out this feeling or can I say 'habit' because the whole situation is different.
People with religious OCD strongly believe in and fear punishment from God and worry about unintentionally hurting other people or in this situation your wife and worry not just about what they think about doing, but also about what they have thought.
Any religious belief can not determine how many children a couple can have and then raise them.
People can be paralyzed by obsessive doubts and worries about their spiritual and moral lives and people know that when they have OCD know what they do is abnormal what have difficulty stopping them, but they can be replaced.
Just think that how you run your family only you and your wife make these decisions, so replace this thought with something else if you can't stop it either by yourself or with help from a psychologist.
Best wishes.
Geoff.