That's pretty messed up.
I had a teacher who always without fail left the door to his office wide open when he was with a student. I remember visiting him once with my friend and as we were about to close the door he quickly told us to leave it open. Then he explained that it was so baseless rumours wouldn't spread. He also explained how some students use such opportunities to uh... ask for better grades.
Had two teachers like this at school too and currently at my university many professors or instructors do the same. Rumors alone can cause your job. Also like you said some try to get better grades through immoral ways and it’s better to not allow situations where a fatal mistake could happen.