A Bentonville judge has upheld the constitutionality of an Arkansas law that prohibits a teacher from having sex with a student, even one 18 years old.