This is a good example for what I'd call the role-playing of taboos. If it was a taboo to show your hand at somebody, they'd do that. It's not the act itself which has any effect - seeing a naked man or woman is not very different from seeing a naked animal which happens all the time - but the implied meaning. The implied meaning of taboos is that what is happening is supposed to be significant.
To get a feeling of how distorted this assumption is, try taking your clothes off in front of an animal and see if it cares at all. Well, little kids don't care either. They begin to care much about as they begin to comprehend human emotions, copying them from the adults again, and seeing the adult emotions being abnormally affected by nudity.
I argue similarly about rape. The act of touching/attaching body organs to each other with another human could be absolutely insignificant, if it wasn't assumed that it's supposed to be. Thus the real terror is created by mirroring the significance which the culprit puts to their own actions.
The kid harassed by exhibitionists is much more harassed by their attitude, which is presuming that what they are doing is "wrong" and significant, rather than by the act itself. The kid can sense that they are unhealthily disturbed by their own actions, expecting probably the kid to get disturbed too, so it may eventually get disturbed. Otherwise it wouldn't. Of course, otherwise the exhibitionists probably wouldn't be taking their clothes off, or if they did, it would have been by some random chance and not as a call to be seen.
It's very strange how people invent such problems for themselves out of nothing. For example, in the old times a fine aristocratic lady forced to sit and eat next to black people would most certainly gonna be sick from the irrational disgust, which she learned from her peers. Nowadays this is overcome. But people still have many other such artificial fears and taboos.