Holden is depressed and has survivor's guilt because of the death of his brother, Allie, from leukemia. Holden can't focus on his classes: he is too depressed to care. We know that Allie is on Holden's mind as the novel opens, because Holden writes an essay for Stradlater, his roommate, about Allie's baseball glove. Stradlater declares the essay is no good.
This leads to the second reason for Holden's lack of motivation for school. Stradlater, who dismisses the essay Holden has written, represents to Holden the superficial values of an elite boarding school environment. To Holden, Stradlater is a phony, and most of the prep school experience is about phony posturing. Holden has come to feel there is more to life than the narrow borders of his insulated school experience.
Stradlater—and this is important—not only represents the phoniness of boarding school to Holden, but also its predatory nature: Holden feels Stradlater takes sexual advantage of females. Holden wants to escape from these confines so that he can protect the innocent in a way he was never able to protect Allie. He wants to become the catcher in the rye, saving children from disaster.