(I am not Japanese nor go to school in japan so this is all speculation)
It seems like the school is in a residential area so the park is probably nearby and would be the more optimal spot to put some benches (because who wants to take a rest in front of a high school?)
Though my American brain immediately assumed it's to stop teens (or creeps) from loitering around school grounds after hours.