Answer:
The said idea can be attributed to the English philosopher John Stuart Mill, who advocated his beliefs in utilitarianism. Which is essentially a belief that all those type of actions that serve to increase and promote one's happiness are right actions, and any action that promotes the opposite of happiness is wrong. Applying this to the context of education, punishment in his view did not align with this belief, and hence, not considered to be beneficial.
Hope that answers the question, have a great day!