Allister Gilbert, a horticulture teacher at Opononi Area school in Northland, was allegedly knocked to the ground, kicked and struck with the spade after trying to discipline a pupil for wearing a woollen "beanie" hat.
Two brothers, aged 16 and 17, have been suspended from the school and face charges in court.
The attack has prompted calls from teachers' unions for more resources to tackle classroom and playground violence. The latest statistics show that 32 children were suspended in the first quarter of the year for violence towards staff.
Martin Cooney, president of the Post Primary Teachers Association, said that overworked teachers are spending a good proportion of the school day trying to stop violent acts. About two-thirds of schools have "pre-suspension rooms", where problem students are given help to avoid banning them from school. Mr Cooney said all schools need such rooms as well as full-time teachers to run them.
Wyatt Creech, education minister, said he deplored the attack, but was not convinced extra teachers were needed.