Why would a headmaster - or any teacher - want pupil data from a previous school in his new position.
Exactly the reason stated - research.
The question is why he was engaging in a research activity without agreement from the subjects using his employer resources without an authorization for that.
The court and the ICO did not dig as deep as they should.
The fact that he was doing unauthorized research using data on his previous pupils raises an immediate question: "What about the current ones". That question was not asked