Hello, and welcome!
My apologies that you did not receive an earlier answer. Various experts are online at different times, and I recently signed on and read your question. Your patience is greatly appreciated!
I'm sorry to hear your cat is doing this when you go away. I'm just curious if this is when you both go away or when only YOU go away and your wife is home. Also, who watches your cat when you're away, if both of you leave? Do you have a cat sitter that comes and stays with your cat, or does a friend, neighbor, relative, etc., come in a few times a day to feed your cat and scoop the litterbox?
What your cat is doing is very normal and instinctive; he (I don't know if your cat is male or female, so I'll use the pronoun 'he' for the time being) is 'marking' territory in yours and your wife's favorite spot because he's stressed and anxious and misses you.
A cat-calming pheromone called Feliway can help modify this behavior by lessening his stress. Here is more information:
As you can see, it comes in a plug-in diffuser, which has no scent to humans, a spray, wipes, and you can even get a collar for your cat to wear, which contains the same pheromone, like one by Sentry or Nurturecalm:
It's also very important that you clean the areas where your cat has soiled with an enzyme based product, so no odor is left behind. Nature's Miracle, Zero Odor, Odor Mute and many others are sold in pet supply stores and are effective. After cleaning with this product, allow to dry and then lightly spray some Feliway over the spot and let it dry completely (about 30 minutes) before allowing your cat access to the areas. The Feliway should make your cat feel as if he's already 'marked' there.
When you're away, leave an old t-shirt or other piece of clothing with your cat, in his favorite spots, his bed, anywhere he likes to sleep (you can leave one of yours and one of your wife's), so he has your scent there and this will be comforting and make him feel more secure.
If at all possible, close off yours and your wife's favorite areas, so they are inaccessible to him.
If he's only doing this when you're away, we know the reason; however, if he's peeing out of box at other times, it's always best to have him checked out by the vet and have a urinalysis, so we can rule out any underlying medical problems, like a urinary tract or bladder infection or crystals in the urine which are irritating.
I hope this helped, and once you start using these products, it might take a little while to work, so patience is essential.
Happy Holidays to you all!
Please be so kind as to rate my answer with positive feedback; that is the only way I receive recognition from the site for my assistance. Thank you very much!
Providing a positive rating will not end our conversation, should you need me for any follow-up. Simply click 'Reply' for clarification or additional information, if needed, and I will be happy to continue.
Just checking in with you to make sure you received my answer and to see if you needed any additional information.
I also wanted to mention that if this problem persists, despite trying the behavior modification techniques for stress/anxiety, you can discuss a prescription medication with your vet. There are several for this purpose, and you can see more information, HERE
Please take a moment to Rate my answer so I am compensated for my time and assistance. Thank you!