S.T.
Little kids are so funny with their fears & thought processes. He may be more afraid of people walking by hearing the tinkle, or of the door accidentally opening, etc. When you go to pick him up maybe go in the bathroom with him while he uses it. (Or stand outside the door). By having mom nearby to guard the door maybe he'll re-learn the process and feel more confident.
I remember having a deathly fear that someone would open the bathroom door while I was in there (we had a single bathroom outside each classroom that faced the hall). I would only use the bathroom if I was horribly desprate.... I eventually got over that but sometime the way the bathrooms are laid out is just poorly planned by men with a blueprint who apparently have no memory of being a little kid at school....!