My parents had two cats. Both of them would refuse to pee in a dirty litter box and also if it was the clumping clay kind, because they would hate it when the clay litter would get stuck on their paws. Another cause was that the cat was getting revenge, either for itself or for another cat/human. My cat would pee in my dad's bed or clothes any time my dad yelled at me and I got upset, or if he yelled at the cat, or another cat. Pretty much the cat decided it was a way to punish someone.