Lets say that people are doing something very bad.
You don't do anything bad yourself, but you don't try to stop it. Someone might accuse you by saying "Your hands are not clean in this matter," or if it is very bad and someone may die, "you have blood on your hands."
Now, let's say you do try to stop it. You try your best. You can't stop it. You give up. You say "I wash my hands of this matter." It means "I tried. I failed. I give up. It's not my fault. Don't blame me."