Cats urinating and defecating anywhere is a psychological problem
Russian Blue Cat
Cats are extremely clean animals, very particular about their daily lives, clearly distinguishing between eating, drinking, and elimination. The litter box must not be near eating or sleeping areas. Some cats are even picky about the appearance, location, brand, type, and quantity of the litter box, so owners must carefully understand the psychology of different cats to adapt to their needs.
Generally, once cats eliminate in a fixed location, they form a habit. But when multiple cats live in one household, they establish a social hierarchy based on their strength. They arrange seniority themselves, with older cats usually occupying higher status, while lower-status cats try to improve their rank through fighting or other means. Lower-status cats must yield to higher-status cats in all matters, which may result in them being denied access to the litter box, leading to inappropriate elimination.
However, if a previously well-behaved cat suddenly shows inappropriate elimination, the owner should pay attention. Besides possible illness, it could be that the cat feels lonely or neglected and deliberately uses abnormal behavior to get the owner's attention. (Source:PetsZone)