If a person has OCD and tends to ritually wash their hands a thousand times because they feel they didn't do it right and they accidentally touch something wet in the sink after or have the worry they touched something ritually impure, do they have to rewash their hands (which may lead to rewashing a ton of times again)?
Anyone discussing OCD and halacha needs to find a qualified, competent rabbi in-person, as well as a mental-health professional.
Reviewing the laws of what actually poses a halachic problem for handwashing might help, depending on the level of one's problem. The entire practice today is a throwback to when ritual purity laws were applicable ... but this is a side discussion. If someone is really OCD, it's going to manifest itself in degrees far beyond what halacha requires.
Rabbi Elli Fischer blogs about Rabbi Asher Weiss' responsum #134 about someone with OCD who keeps repeating words of prayers, always worrying they didn't pronounce them right. (Rabbi Asher Weiss is the posek for a major Israeli hospital, so he understands the solution here is more than "say another piece of Tehilim.") He says if the doctors tell this person to never repeat a word from prayers, even if you think you mispronounced it, then listen to the doctors!
I would strongly assume the same applies in a hand-washing case.