Moaning Myrtle, the resident ghost of one of the Hogwarts bathrooms, has a bad habit of leaving her bathroom and spying on male students in various stages of nudity. She makes Harry very uncomfortable, and although she assured him she hadn't been watching him, he isn't at all sure if to believe that:
“Myrtle!’ Harry said in outrage. ‘I’m – I’m not wearing anything!’ The foam was so dense that this hardly mattered, but he had a nasty feeling that Myrtle had been spying on him from out of one of the taps ever since he had arrived.
‘I closed my eyes when you got in,’ she said, blinking at him through her thick spectacles. ‘You haven’t been to see me for ages.’
‘Yeah … well …’ said Harry, bending his knees slightly, just to make absolutely sure Myrtle couldn’t see anything but his head, ‘I’m not supposed to come into your bathroom, am I? It’s a girls’ one.” - Harry Potter and the Goblet of Fire, Chapter 25 (The Egg and the Eye)
Though she maintained that she wasn't watching Harry, she later admits that she does sneak into the bathroom to watch people take their baths:
‘Well … anyway … I’d try the egg in the water. That’s what Cedric Diggory did.’
‘Have you been spying on him, too?’ said Harry indignantly. ‘What d’you do, sneak up here in the evenings to watch the Prefects take baths?’
‘Sometimes,’ said Myrtle, rather slyly, ‘but I’ve never come out to speak to anyone before.’
‘I’m honoured,’ said Harry darkly. ‘You keep your eyes shut!’ He made sure Myrtle had her glasses well covered before hoisting himself out of the bath, wrapping the towel firmly around himself and going to get the egg.” - Harry Potter and the Goblet of Fire, Chapter 25 (The Egg and the Eye)
Also of her own admission, she was watching Cedric take his bath:
‘Well, that’s what Diggory thought,’ she said. ‘He lay there talking to himself for ages about it. Ages and ages … nearly all the bubbles had gone …’ - Harry Potter and the Goblet of Fire, Chapter 25 (The Egg and the Eye)
This is inappropriate behavior. She's using her abilities as a ghost to spy on people while they take their baths. That's sexual harassment. She can't do anything physical to them, but I doubt most people would be willing to accept "but I'm just watching I wasn't actually going to touch you" as an excuse for someone watching them bathe without their consent. The students are likely either unaware of her presence, or like Harry, made incredibly uncomfortable by it.
So, why hasn't the Hogwarts staff done anything about it?
It seems odd to think that the staff would be unaware of her or her behavior. She clearly can move around the school to different locations, so is a professor likely to have encountered her in the bathroom? In addition, if a student ever mentioned this, the staff would have no reason not to believe them. They know ghosts exist and live in Hogwarts, and they presumably would know Myrtle lives in one of the bathrooms there.
But it seems even odder to think that the Hogwarts staff would know and allow it to continue. Some of the professors might have a looser opinion on discipline, but there are certainly enough professors who surely wouldn't willingly let that happen in their school. I know the Ministry has ordered Myrtle to stay in Hogwarts:
‘Olive Hornby came into the bathroom – “Are you in here again, sulking, Myrtle?” she said. “Because Professor Dippet asked me to look for you –” And then she saw my body … ooooh, she didn’t forget it until her dying day, I made sure of that … followed her around and reminded her, I did, I remember at her brother’s wedding –’
But Harry wasn’t listening; he was thinking about the merpeople’s song again. ‘We’ve taken what you’ll sorely miss.’ That sounded as though they were going to steal something of his, something he had to get back. What were they going to take?
‘– and then, of course, she went to the Ministry of Magic to stop me stalking her, so I had to come back here and live in my toilet.” - Harry Potter and the Goblet of Fire, Chapter 25 (The Egg and the Eye)
But the Ministry presumably didn't order them to let Myrtle do whatever she wants at Hogwarts, so the staff should still be able to do something about her behavior. In addition, that the Ministry was able to stop her from following Olive Hornby around shows Myrtle can be controlled, she's not an uncontrollable poltergeist like Peeves, it's possible to reprimand and manage her.
So, why hasn't the Hogwarts staff stopped Myrtle from spying on students in the bath?