Cats don't actually give you privacy in the bathroom. They follow you because they are curious, want attention, or are scent-marking.
The bathroom offers interesting scents and sounds, and cats enjoy being near their humans. They're independent creatures who don't understand the concept of privacy.
In short, your cat isn't respecting your privacy—she just wants to be with you.