The reasons that Carroll fantasized about this killing spree were; 1 The teacher got a sick thrill from beating his pupils, and 2 Carroll was high on heroin.
Of course, one does not need to become a drug addict, in order to desire revenge against power mad tyrants, who exploit people that they believe themselves to be morally superior to.
He can't go home and his only escape from the reality of the streets is heroin for which he steals, robs and prostitutes himself.