A cat may defecate outside its litter box because the cat is stressed, the box is not clean enough or because the cat has an aversion to the box itself. Cats can be finicky about the size, location and form of the box, as well as disliking the litter.
Unlike dogs, cats prefer to defecate in certain set locations, and under normal conditions, they are taught where to defecate by older cats when they are still kittens. However, sometimes stress can lead to a cat defecating outside its designated spot. This can especially be the case after a recent move.
Cats may also defecate outside the litter box if the box goes too long in between cleanings. Cats dislike using soiled litter and will choose a more sanitary spot to deposit feces if the litter box is full.
Finally, sometimes the litter box is the source of the problem. If the litter box is an inappropriate size, hard to get into and out of or in a location that the cat does not like, the cat may refuse to use it. In some cases, the cat may dislike the smell or feel of the litter but not the box.