My cats follow me into the bathroom; I always leave the door open a tiny bit (unless I'm taking a shower ... one of my cats has yet to clue into the fact that leaping into the tub while the water's running means he gets wet). If I close the door on the cats, they sit outside the bathroom and cry to be let in. (Sucker that I am, I usually cave and let them come in -- unless I'm taking a shower, or we have company over. Friends and family don't need to see me going to the bathroom.
) My boyfriend doesn't let the cats follow him in, and he never has (whereas I've always been a pushover); Spike and Oz (my two cats) will occasionally sit outside the bathroom while he's in there, but they don't cry or scratch at the door the way they do when I'm the one using the bathroom.
As for why they do it ... I have no idea, although it is pretty hard to ignore your cats when you're sitting on the toilet and they're staring up at you, so maybe it's just a way for them to get some undivided attention? Or maybe it's just because they react to the closed bathroom door the way (most) cats seem to react to any
closed door: it must be opened for them, and then they
can decide whether or not they actually want in.
On the other hand, maybe they just think we really can't do anything
without their help?