Kant's theory of morality begins with the question that arose with Aristotle and Aquinas, "what is good without qualification?" Compare this with Aristotle's "what is the good for man as such?" Aristotle conceived of the human being as a no less an animal than a rational being, so the good (at least the moral virtues) involve a balance between reason and the passions. Even in intellectual contemplation there is some reliance on the body.
In the modern tradition, following Descartes, the mind or soul is held to be completely separate from body. Kant was concerned with the soul alone, or that part of it he called the "rational will." Thus he thought the question of the good applies to beings only insofar as they are rational. Other circumstances, i.e., their desires and inclinations, the physical situation, are irrelevant.
So Kant rejected the Greek notion that "happiness" (eudaemonia) is the good. Rather, the good is to be located in a good will. "A rational and impartial spectator can never feel approval in contemplating the uninterrupted prosperity of a being graced by no touch of a pure and good will." The moral virtues can be used to any end, and without a good will, they may make a man worse, as with a "cool scoundrel" whose coolness enables him to operate more effectively. In general, the consequences of actions are irrelevant to morality as well, whether they lead to happiness or misery, pleasure or pain.
So where are we to look for goodness in a rational will. It is not in the ability to find the best means to a given end, as the Greeks would have it. Means/end rationality is only hypothetical, and the end of the use of reason in this way (happiness, pleasure, etc.) has been rejected as the source of the good. The answer is that we should look at the motivation of the will. Sympathy or toward others is not what makes a person good; a cold-hearted person doing acts of charity is the model of a good person, who acts contrary to his own inclinations.
The value for an act is to be found in the maxim or principle under which the rational will carries it out. Most of the time, our maxims are of the means/end variety, but sometimes they are directed toward obedience to the law itself. In theological ethics, e.g. Christian ethics, the value of an act consists in its having been done to obey the law of God. But Kant's ethical theory is secular. Thus it holds that good acts are those which are done out of reverence for the law as such, for the law just insofar as it is the law.
So any maxim we act upon yields a good act when it can be willed to become a universal law. The injunction to act this way is called the categorical imperative. It is categorical in that it requires a way of acting in obedience to law which is independent of any end other than lawfulness itself.
Because the categorical imperative is so abstract, Kant gave several illustrations of its application. In the first, a person is moved to commit suicide because of his misery, which has no prospect of remission. The maxim of his action would be, "end your own life if it has no tolerable prospects." But, Kant argued, this maxim cannot be willed to be a universal law. The idea is that the principle designed to further life (self-love) actually destroys life.
The second example is more revealing. Here the maxim is, "make a promise you cannot fulfill if it is the only way to avoid misery." This maxim fails the test of universalizability because if everyone followed it, making promises would become worthless. Nobody would believe anybody else.
The third example shows the power of the categorical imperative (perhaps it is too powerful). The maxim here is to fail to develop one's talents in the interests of continuing an already-pleasurable life. What is wrong with this? In some ways, it embodies the American Dream. Kant claimed that this cannot be willed to be a universal law because a rational being "necessarily wills that all his powers should be developed, since they serve him, and are given him, for all sorts of possible ends." So we have a duty to develop our talents because of their possible uses, even if they have no other value in our lives!
The final example is that of the person who wills to leave everyone else alone when he could help them. This "hands off" attitude could be willed to be universal without destroying life, but Kant claimed that it would undercut itself in that someone might need the help himself. As Schopenhauer (a German successor to Kant) pointed out, this smacks of egoism.
Our relations to other persons forms the basis for a second formulation of the categorical imperative. We should treat other persons as ends in themselves rather than as means to other ends, which would be how we would treat them using means/end rationality. The example of a lying promise brings this out. If I borrow money from you on the promise of repayment, knowing fully well that I cannot repay you, I am using you for my own ends. On the other hand, treating people as ends in themselves is to treat them with dignity.
I want now to mention two classical problems with Kant's theory, the first having to do with the separation of morality from consequences, the second with its separation from the human passions. In the Old Testament story, Abraham was commanded by God to kill his son, an act which he was willing to carry out because it was the will of God. Similarly for Kant, one must not lie even though so doing might save another's life, say that of a Jewish person being hidden in the house from the Nazi persecutors. Most of us believe that consequences can be mitigating factors.
Secondly, Kant asserted that a cold-hearted person performing a charitable act solely from duty is acting in a morally praiseworthy way, while someone doing so from the passion of kindness or sympathy is acting in a way that has no moral value. Again, most of us believe that "good-heartedness" is a moral virtue.
Acting through the rational will requires freedom, Kant asserted. The exercise of the will must not be determined by anything external to the agent if an act is to be praiseworthy. Here Kant repudiated the doctrine of Hobbes that reconciles liberty with necessity. But acting on a maxim is acting according to law, which determines the person to follow it. This is possible, Kant claimed, because the rational will is a law unto itself, that being rational generates its own laws.
Kant based morality on pure reason, but what could be the end of the use of reason if not to satisfy our passionate desires, e.g. for happiness, pleasure or security? It could only be to obey the law which reason commands to itself. Such a law is that we should act only on such a principle that we can will to be a universal law. This categorical imperative is supposed to sanction various substantive moral principles, e.g., "Always tell the truth," and "Always keep your promises."