Cruel to be kind
The philosophy of short-term severity as having longer-term benefits, which was classically expressed by Shakespeare in Hamlet Act III, Scene IV, “I must be cruel, only to be kind.”