Our adult male cat never had a spraying problem until we were taking care of another cat for a month. Since then it's been an issue. Our female cat (who we adopted at the same time as this male problem cat) isn't doing it.
We took him to the vet a few months ago and he had a really bad UTI. Meds...