He is suffering with Feline Urinary Syndrome, it's an issue with crystals forming in the urinary tract, which cuts it and hurts the creature to pee.
Special food is the answer, in most cases, one with a higher acid content: it prevents the crystals from forming.
Yes, it's more common in male cats, and no, I don't know why. I DO know that my one cat spent a full year on vet's food (expensive) before I could switch him back to a name-brand that bragged it balanced urinary pH (it did the trick).
We also went the extra mile and bought some of the vet-brand wet food, which he was given once a day, for the first month or so after being diagnosed: it let the poor thing heal, he'd been crying and pee'ing blood every time he went into his litter box.