I used to be highly compulsive that way, and I am not now. I even find I forget to check the lock at times, now, and I don't know if someone else did check it or not. I do things to be cautious, but I am not compulsive about it anymore, so I believe you can overcome your obcession.
I realized that my anxiety stemmed from feeling helpless to protect myself. I don't know what the source of yours is, but I know when I faced my feeling of helplessness then I got over the compulsion. For one thing, tell yourself that it is totally normal to feel scared of those conditions, because it IS normal! I think one way we can get stuck on a thought is to obcess that we are over-reacting, and not being normal.
If someone really wants to break in, what we do is not going to stop them. If anthrax is where we are, washing our hands is not going to stop us from getting it on us...we have to tell ourselves the truth when our mind comes up with lies. That breaks the habit cycling in the mind. Think of the fact that most people are safe most of the time, and that you are safe right now. We cannot control our surroundings, but we can train our minds and control what we allow ourselves to dwell on.
I don't think it is helpful to allow yourself to reinforce the lie that if you just do something so many times something else will not happen. I think actually washing your hands so many times is reinforcing the thought in your mind. Tell yourself the truth, that one washing is clean enough.
I am not saying this is a quick fix, or it will be easy to break the obcession habit. It will take time. Don't be concerned about the times you fail to ignore the compulsions, but instead, just give yourself some space to be human and make mistakes. There is a lot going on in the world that is out of control, and I suggest that you lean on whatever faith you have.
I am not writingg of will-power, but of choosing to
I think it is totally normal to feel insecure about those things, and that you can and will get a grip on your thoughts!!