"It is wrong because the teacher, whether male or female, is in a position of authority and influence over the student"
I can see that if the boy has mental problems or intellectually challenged. But in general, I go back to "there is a difference between males and females." A normal teen age boy is a predator, similar to a baby/teenage snake being a predator. And a teenage boy, even though an evolutionary predator, is old enough to curb his instincts whether he is "influenced" or not. With many, the only influence a teacher would have in that arena is how good she looks.
As to the act of the teacher being immoral, yes in a general sense. But relatively speaking the boy would also be immoral. However, I would engage and then ask forgiveness. The real problem here is that the teacher did not act like a teacher and it should not be illegal but against school rules and should be fired. Just my opinion.