I'm a high school teacher. On one occasion, some boys in my form group (aged 15/16) disclosed to me that they felt extremely uncomfortable using the toilets whilst a trans pupil (female identifying as male) was present in them. They were not being derogatory or callous but felt that it was an invasion of their privacy. They said that they avoided using the toilet at break times and had started going during lesson time instead (thus losing out on learning time).
They also felt uncomfortable about it because they recognised that it's an intimidating situation for a girl to be surrounded by boys in the toilets and that it just didn't feel right to them to 'expose' themselves to a girl. They knew instinctively that men exposing themselves can intimidate women or make them uncomfortable. Just because a female pupil identified as a male, this did not remove their moral instinct to not make her uncomfortable.
The discomfort was two-fold. They were concerned for their privacy and dignity but they also felt as though it was forcing them to do something which went against their moral code.