All behavior serves a purpose. Your pets are not behaving "out of spite".
Many animal guardians truly believe that their cat, dog, bird, rabbit, pig, horse etc. does things “to them” out of spite or malice. New Flash: This is not true.
When we don’t know how or why an animal behavior problem exists, we tend to make it about us; we personalize it.
This is very harmful to our relationship with our animal companions! When we label our pet's behavior, instead of investigating the underlying cause of the behavior (whether it's medical, emotional, environmental. etc.) we are unable to view the full picture of what's happening within the animal, and within their environment. We fail to help them.
Here are 8 Things We Must Acknowledge when it comes to behavior we don't understand / behavior that upsets us: consciouscompanion2012.com/2013/08/05/was-it-for-spite-think-again/
If you have a senior/geriatric cat who has been struggling with his/her litter boxes, check out this article: petcha.com/pet_care/solving-litter-box-problems-in-senior-cats/