Cats love to cool down on hot days, and the bathroom is a great place to do that.
Cats are fascinated by running water, and the bathroom is full of it. They love to watch the water drip from the faucet, and they may even try to catch it with their paws.
Cats are solitary creatures, and they need a place to go where they can be alone.
Many cats have their litter box in the bathroom, so they associate the bathroom with using the bathroom.
Cats feel safe and secure in enclosed spaces, and the bathroom is often a small and cozy space where they can feel comfortable.
Cats love attention, and they know that when they are in the bathroom, they are likely to get it.