* They're curious: Cats are inherently curious creatures. The bathroom, with its many interesting scents and sounds, is a natural draw for them. They might be curious about what you're doing, but more likely, they're drawn to the running water, the strange smells of toiletries, or the rustling of paper towels.
* They want attention: Cats are social animals and they love to be around their humans. They may be trying to get your attention by hanging out near you, even if it's just in the bathroom.
* They're scent marking: Cats have scent glands in their cheeks and paws, and they use them to mark their territory. They may rub on the bathroom door, or even try to rub on you, as a way of leaving their scent and claiming you as part of their territory.
* They're independent: While they love attention, cats are also very independent. They're not going to be bothered by you doing your business. They might just be curious, and they might decide to hang out for a bit while they're there.
In short, cats don't give you privacy in the bathroom because they don't care about your privacy. They're more interested in what's going on, the smells, and the chance to spend time with you.