All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ʻalayhi wa sallam, is His slave and Messenger.
The fines levied by a school on the students for violating the school rules fall under the category of financial penalties imposed as a form of discretionary punishment (t'azeer). The scholars held different views regarding such form of discretionary punishment. The majority of the scholars deemed it prohibited. As-Saawi even underlined the scholarly consensus on the prohibition in this regard and narrated that some of the Maalikis maintained the permissibility of imposing penalties on the offender's wealth (in form of destroying, changing or confiscating wealth) as a form of discretionary punishment and not financial penalties, as in the case with the adulterated goods; they should be confiscated and given in charity.
Ibn Taymiyyah and Ibn Al-Qayyim held that it is permissible to impose financial penalties as a form of discretionary punishment relying on the judgment of the Prophet, sallallaahu ʻalayhi wa sallam, who ruled that whoever hunts in the Sanctuary (the sacred bounds) of Madeenah, his animal shall be confiscated as a discretionary punishment. He, sallallaahu ʻalayhi wa sallam, imposed financial penalties as a form of discretionary punishment on the thief who steels an item that has no hirz (safekeeping) as in the case of the one who steals fruits or the like, which does not warrant cutting off the hand.
Based on the view of the majority of the scholars who deem it prohibited to impose monetary fines as a form of discretionary punishment, which is the scholarly view adopted at Islamweb, this money should be returned to the students who paid it, and the school should stop imposing such fines in the future. If the payers cannot be identified and the money cannot be returned to them, then it should be spent in charity for the poor and needy on behalf of those payers.
Allaah knows best.