Yes, the employer may do this. While you cannot be monitored by video or audio monitoring while in the restroom, there is no restriction on noting how often, when, or for how long you go to the bathroom--and for then criticizing the employee for spending too much time in the bathroom. Indeed, if you don't have an employment contract limiting the grounds or reasons for termination, you could be fired if your employer thinks you spend too much time in the bathroom.