Without knowing more information about your specific case, it is not possible to give a definitive answer. The school district might believe that certain types of teacher / student relationships, particularly outside of school, are inappropriate. If the district applies a policy reasonably calculated to prevent inappropriate relationships, and that policy is not arbitrary or discriminatory, the policy would probably be allowed. You might want to contact an attorney to discuss your specific situation in more detail.