Locke now addresses the education of the mind. In forming a sound mind, Locke explains, we are chiefly aiming to form a virtuous mind. The most important aim of education, in other words, is to instill virtue; education is first and foremost moral education. Though academic learning is necessary and important as well, it is the child's moral character that is of the utmost concern. The strength of body, as we just saw, lay in the ability to endure hardships. The strength of mind, as it turns out, is not all that different. A strong mind (that is, a virtuous character) is one that has the ability to go without what it wants. Self-denial, according to Locke, is the principle of virtue.
A man is virtuous only insofar as he can act against his own immediate desires when reason tells him that this would be for the best. For example, imagine that a man wants to eat an entire birthday cake. Reason tells him that this would not be fair, because everyone would like a slice. A man with the principle of virtue will have the ability to listen to reason and exercise restraint over his appetites. A man without this capacity, on the other hand, will be unable to heed reason, and will eat the whole thing. The first man will behave virtuously, the second will not.
Since the key to being virtuous is to have this capacity of self-denial, the most important goal in education is to instill this capacity. Unfortunately, Locke thinks that the way that people generally raise their children has the exact opposite effect: it prevents this quality from taking hold. This is because parents tend to find their small children so adorable and lovable that they indulge their every wish. Parents find themselves unable to deny their babies anything.
The reason that overindulgence is so bad is that the mind is most malleable during extreme youth. This is precisely the time, in other words, to ensure that the child becomes pliant and obedient to reason. The first thing a child should learn is that he cannot have everything that he wants; he can only have what he wants if reason concurs that this would be for the best. Of course, children do not have much of reason their own at this age, and so they must be made obedient to their parents' reason instead. If a child becomes accustomed to denying his desires whenever his parents forbid him from indulging those desires, then, as the child matures and his own discernment develops, he will also be able to deny his desires when his own reason dictates against indulging those desires. If, on the other hand, a child is accustomed to getting whatever he wants, then he will continue to expect to get his every wish fulfilled as he matures. In other words, he will lack the principle of virtue.
In sum, a child must be made completely obedient to his parents from the earliest possible age. The child must be perfectly compliant with will of the parent because the will of parent is a surrogate for the child's future faculty of reason.
By indulging their children's desires, parents are being passively negligent concerning moral education. However, Locke accuses, parents are also often guilty of being actively negligent by teaching vices outright. Parents teach violence, revenge, and cruelty by joking about these matters. They teach vanity by fussing excessively over their children's clothes. They teach lying and equivocations by indulging in this behavior in front of their children. And they teach intemperance by constantly pressing food and drinks on their children.
Locke's claim that self-denial is the foundation of all virtue is controversial, since there are other characteristics that could lead to virtue. One might argue that a person will be virtuous so long as he thinks of himself as only one person among any, with no special moral status. So long as a man thinks in this way he will tend to behave justly toward other people. A person who follows this rule, someone might argue, would be in a better position to always act virtuously than someone who had Locke's capacity for self denial. One might also argue that a person will be virtuous so long as he makes sure that every action he commits will not affect the world negatively. In order to understand Locke's faith in reason, it is important to take a look at his other works, for instance the ##Second Treatise of Government## and Essays Moral and Political. Locke had a very particular view of human rationality and of its relation to moral goodness. He thought that God had fashioned us in such a way that, when used correctly, our rational faculties revealed to us the various natural laws (which are laws, stemming from God, that tell us what is right and wrong). The most important natural law is this: protect all of God's creatures. The way that you get to this law through reason is by the following line of thought: we are all equally God's children and therefore God wants all of us to be alive and thriving. Therefore, we should help both ourselves and others to stay alive and happy.
The alternative candidates we presented as rivals for Locke's principle of virtue, in fact, are simply the sorts of maxims that reason would tell you to follow on Locke's scenario. They are on a par with Locke's laws of nature, not with his principle of virtue. His principle of virtue is not simply a maxim or a test that reason uses; rather his principle gets down to the very heart of human morality — to the psychological struggle between what we want and what we know is right. Seen in this light, it seems likely that Locke really has found the best candidate for the foundation of all morality. If you can consistently win the battle between what you want to do and what you know you should do (e.g. that you should protect all of God's creatures, that you should do onto others as you would have them do onto you, or that you should only act in such a way that if everyone acted that way there would be no problem) then you will, obviously, consistently do right (granted that is, that you always know what is right, which, as we saw above, Locke thinks that you do).