When Good Cats Go Bad.
Cats use litter boxes or go outside because that is where they want to go.
When good cats go bad and start peeing where you would rather they didn't, there are many possible reasons. The litter box could be dirty, smelly, too small, in the wrong place, or too crowded. You may need multiple litter boxes spread around through the house. You may be using a type of litter your cat doesn't like. Another cat, dog, boyfriend, or baby in the house, or even some anonymous outside cat who has begun cruising the neighborhood may make your indoor cat feel that he or she has to start marking territory to make it clear who's place this is.