Why do you think the law is unconstitutional, rather than just bad policy. (I don't think it's either)
Although I might argue that it should not be a felony, but rather a mandatory firing offense, with the additional provision that the person's teaching certificate be revoked and never reissued.
What specific part of the Constitution do you think this law violates. Not equal protection, all in the same circumstances suffer the same penalty. There is a "reasonable basis" for the law. It's certainly not arbitrary.
No, equal protection would mean that anyone who has sex with someone over 18 would be okay. You can NOT make it a felony only if you are a teacher.