Cats on different occasion decide to urinate and defecate in different areas. To solve this problem avail two different litter boxes for the cat. This could also be a sign of a medical reason like pain while defecating. The pain is associated with the litter box and the cat decides to avoid it.
it could be that your cat does not feel that the litter box is clean enough try getting a new litter box and change brands of litter. my cat will urinate in clumping litter but only poop in nonclumping litter