Immanuel Kant’s idea on ethics may give an answer to the question we are interested in. However, before the answer can be derived, some of his basic ideas have to be considered. Kant worked on his theory of ethics by first distinguishing things that are good as merely a means and things that are intrinsically good or good in itself. He conceived a good will as the only thing that is good in itself since its value is unconditional and does not depend on what results it will give. Other good deeds such as courage, intelligence or judgment on the other hand are desirable in many respects but they can be extremely bad when used by the will that is not good.
Reason is viewed by Kant to have a true function of producing a will which is good, not as a means to some further end, but in itself. The capability of reasoning of human is not for making him happy because any other instincts would have served that end more effectively but is intended for the supreme condition which Kant calls duty. As human beings are rational, they are therefore capable of true freedom. When human freely acts in accordance to the law of reason, he is performing his duty.
An action which is done out of natural inclination, for example because of desire or affection is not morally praiseworthy according to Kant. Only if someone acts without any inclination but out of duty alone, does his action have genuine moral worth. For example, if a grocer did not overcharge inexperienced customers because it would be bad for his business