It sounds like you used the enrollment plugin which did create all the enrollments for the students. Teachers where NOT part of the enrollments and therefore were not added their corresponding role. Your courses must be set to internal enrollment only which prevent any one from enrolling, including teachers.
Hope this makes sense,
regards,
eric.