It's unclear how this law prohibits any of that. But even if the law helped advanced a state interest, is said interest compelling enough to justify regulating the private conduct of consenting adults? I'm not a big proponent of "slippery slope" type arguments but in this case that's what it boils down to: either we draw the line at the government regulating private sexual relationships between consenting adults, or we just need to file form F-1938 in triplicate before we can initiate flirtation.
Well, it doesn't prevent that, but like you said, its the whole "slippery slope" thing. There is probably a greater chance that a teacher would engage in unethical behavior (grade inflation) if she was dating the student, as opposed to a strict teacher-student relationship. In fact, we know that intimate relationships often entail more intimate acts of disclosure and trust (youre more likely to trust a best friend or a parent than your boss or stranger). As such, there is a greater likelihood that a teacher would engage in more intimate acts of disclosure (I am going to give you the answers to the test because I trust you) if she dated the student, as opposed to not dating him or her.
Personally, I don't think any teacher should date a student (even an 18 year old) if the student is being directly taught by the teacher.