The teacher isn't writing the student off; it's the other way around. If the student doesn't wish to learn, it's not really the teacher's job to make them want to learn.
More realistically, however, the educational system has made learning an extremely unpleasant thing. Most students find it extremely painful to actually pay attention to school, and the employees are slowly facing the fact, by making the grading easier and by encouraging "social" aspects of school (I honestly had my high school guidance counselor tell me that most students didn't look back at school as a learning experience, but as a social experience. I remember thinking, "So *that's* why all these people are so f**ked up! They think this is what real life is like!").
The social aspect of school is the social aspect of a prison. There are a bunch of humorless assholes to keep you in line, a few people worth talking to here and there, you don't know who you can trust, and you don't know what will get you in trouble the next day.
The only reason the educational system stays the way it is is that nobody can agree on a better alternative, and by the time the people who could be useful, functional members of society, they've been mentally bludgeoned into being useless, sheeplike breeders of society.
You are what you think.