A cat peeing on walls inside the home is scent marking territory. Strictly speaking it is not what is euphemistically described as ‘inappropriate elimination’ because the cat’s objective is not to eliminate urine because his bladder is full but to send a message to other cats.
The most likely reason why a cat is spraying urine horizontally into walls is to establish and retain territory because he/she feels threatened or is stressed. The tail will quiver and the feet may tramp a bit. Cats normally do it outside in gardens against bushes or fences.
It may occur when a new cat is introduced into the household or if the cat sees a threat outside the home while watching through the window. Perhaps there is a stray cat which routinely wanders through the garden. Cats don’t recognise the existence of windows as barriers so they consider the intruder outside as a real threat to their territory (home range) and re-establish their status or presence by scent marking the walls.
Urine scent needs to be topped up to tell other cats that the scent marking cat is around and current. Because scent fades it can give the impression that the cat has gone from the territory. This is why a cat might spray the same place over and over.
My research on the internet shows a lot of ignorance about scent marking. Most responses to question about cats peeing on walls referred to health issues and inappropriate elimination (not using the litter box). A cat spraying to scent mark will never use the litter box. It has to be done in a prominent position within the cat’s home range where other cats are likely to smell it and ‘read’ what it means.
Notwithstanding what I have written it is always wise to ask a vet to do a check up but health is unlikely to be behind this natural feline behaviour.
The cure may be to prevent the spraying cat seeing outside cats and to introduce new cats gently. Reassurances may help. The Thundershirt may assist. The chemical Feliway may also assist. But it is normal behaviour and the cat should not be criticised or punished.