Immanuel Kant said this quote

An action, to have moral worth, must be done from duty.