Legislature passes bill limiting who can teach sex education