Firts of all, take the cat to a vet so they can check if the cat is sick, urinary infection or anything else.
I have a femalecat that liked to pee on clothes (if they were lying on the floor). A cat no matter gender can start peeing if it feels insecure. My cat stopped peeing on clothes after I had her neutered. The oldest cat is the dominant cat here and she probably felt threatend by having another fertile cat in the house and the younger one noticed that and started to feel insecure. However the problem is now solved and we don´t leave clothes on the floor.
Fertile males often spray (urinate) to mark it´s territory. Cats don´t like dirty cat boxes. My oldest female won´t use a dirty box so keep the box clean. Do not use strong chemicals when you clean the box and don´t use anything that smells lemon, most cats don´t like the smell of lemon. I only use hot water when I clean the box.