My cat does this too. She tends to follow me around the house when I'm working (sits in the middle of the kitchen and talks to me when I'm cooking or washing dishes) and she almost always follows me into the bathroom if I don't shut the door completely. I can even count on it in the middle of the night. I can see that it would be a bit disconcerting. Tails get in the way and stuff.
She also always wants to be in the bathroom when I'm showering. I usually wait for her to be in with me before I shut the door (conversely my husband's cat DOESN'T like to be shut in that way) When I push back the shower curtain she's always waiting on the mat (I tell her she's a good guard cat!) and wants attention.
I can't blame her for wanting to be in the bathroom with me at either time, since that's the one room she's worked out a good petting, no matter what I'm doing.