This is never explained in the book, so we have to make assumptions based on the text, and particularly on the dialogue. Holden gets in trouble, but he is not the kind of boy the teachers would describe as a troublemaker. We see in his meeting with Mr. Spencer that he is always courteous and considerate. For example, as soon as he sits down in Mr. Spencer's room he asks:
"How's your grippe, sir?"
Moments later there is this exchange:
"Life is a game, boy. Life is a game that one plays according to the rules."
"Yes, sir. I know it is. I know it."
Holden privately thinks, "Game, my ass." But he is consistently courteous and respectful throughout. He keeps calling the old teacher "sir." This is certainly one of the qualities that teachers would appreciate. Holden is a young gentleman, not a hoodlum, in spite of the fact that he has been expelled from three schools, including Pencey.
Holden obviously has an extremely high IQ. This is demonstrated by the observations he makes throughout the novel, which is supposedly a memoir/confession he wrote entirely by himself. His teachers can see that he is a special case--not one of the disruptive, surly, rebellious types who are so hard for a teacher to handle in a classroom setting. The teachers can see that Holden has great "potential" but no "motivation," to use a couple of words popular in the field of education. They not only see it in Holden's speech and body language, but they can see it in the papers he turns in whenever he feels sufficiently interested in a subject to write a paper. Some students' papers stand out head and shoulders above the run-of-the-mill stuff the other students turn in. Holden's show originality and superior intelligence.
When Holden goes to see Mr. Antolini, his former teacher asks:
"How'd you do in English. I'll show you the door in short order if you flunked English, you little ace composition writer."
Teachers really read papers, and they appreciate honesty, originality, sincerity and intellect even in students who are ugly ducklings, so to speak. Teachers realize that there is more to life than school and that some kids come from dysfunctional families and have all sorts of personal problems that might account for poor scholastic performance.