Quite often pets defecate or urinate in certain areas as part of their territorial behavior. It is essential to eliminate stress from external factors for your pet that might be causing this kind of behavior. You can get in touch with a local pet psychologist and they can help you determine which stress factors might be causing your pet's behavior.
Animals that feel trapped inside the house or are bored can cause unwanted behaviors as well. Make sure you play with your pet frequently and take him for walks on a regular basis to keep him happy and reduce the chances of soiling in your house.
With cats, the placement and amount of litter trays might be important as well. If a cat is constantly re-soiling in a certain area, you might need to put a litter tray in this area.It might also be beneficial to change the kind of litter you are using.