If any money appropriated to the use of schools is applied by a town or school district to any other purpose, such town or school district shall forfeit the amount thereof to the state and the Comptroller shall sue for the same on behalf of the state, to be applied, when recovered, to the use of schools.