I cannot forbear adding to these reasonings an observation, which may, perhaps, be found of some importance. In every system of morality, which I have hitherto met with, I have always remark'd, that the author proceeds for some time in the ordinary way of reasoning, and establishes the being of a God, or makes observations concerning human affairs; when of a sudden I am surpriz'd to find, that instead of the usual copulations of propositions, is, and is not, I meet with no proposition that is not connected with an ought, or an ought not. This change is imperceptible; but is, however, of the last consequence. For as this ought, or ought not, expresses some new relation or affirmation, 'tis necessary that it shou'd be observ'd and explain'd; and at the same time that a reason should be given, for what seems altogether inconceivable, how this new relation can be a deduction from others, which are entirely different from it. But as authors do not commonly use this precaution, I shall presume to recommend it to the readers; and am persuaded, that this small attention wou'd subvert all the vulgar systems of morality, and let us see, that the distinction of vice and virtue is not founded merely on the relations of objects, nor is perceiv'd by reason.
The first thing to do in interpreting a passage like this is to determine the context. This passage occurs at the very end of Treatise 3.1.1, which is titled, "Moral distinctions not deriv'd from reason". At the time Hume was writing, there were two major philosophical camps on the explanation of moral obligation, who have come to be called the rationalists and the sentimentalists (or moral sense theorists).
I can let Hume lay out the character and history of the first camp (this is from Enquiry III.2, and Hume is speaking of Montesquieu):
This illustrious writer, however, sets out with a different theory, and supposes all right to be founded on certain rapports or relations; which is a system, that, in my opinion, never will be reconciled with true philosophy. Father Malebranche, as far as I can learn, was the first that started this abstract theory of morals, which was afterwards adopted by Cudworth, Clarke, and others; and as it excludes all sentiment, and pretends to found every thing on reason, it has not wanted followers in this philosophic age.
Hume, of course, was quite familiar with Malebranche on this as on other subjects. In Malebranche's account, we perceive ideas, and we recognize truths by recognizing relations or rapports between them. There are two basic kinds of relations: (1) relations of equality or inequality in greatness and (2) relations of perfection. Relations of equality or inequality are the ground of necessary truths: two plus two equals four and does not equal five. That sort of thing. Relations of perfection are the ground of our obligations; all these relations together express the divine Order that should direct our love. Thus, for instance, souls are more perfect than body, which means we should always love souls (including our own) more than any body. Not conforming to this principle would be irrational, a violation of Reason itself. The other moral rationalists Hume mentions do not have exactly the same system as Malebranche, but the point is that each holds in some way or another that we discover what we ought to do when reason perceives relations between ideas.
This is opposed to theories that do not "exclude all sentiment" but, on the contrary, put sentiment front and center. The most notable example is found in Francis Hutcheson. Hutcheson had argued that we call something good or evil based on whether it causes a pleasant or unpleasant sensation in a sensing creature. One of kind of pleasant or unpleasant sensation is the feeling of approbation or disapprobation that consistently arise when we consider affections, actions, temperaments, and sentiments of ourselves or others. This feeling of approbation or disapprobation is the ground on which we call something morally good or evil; in keeping with Hutcheson's standard terminology, the feeling is also called the perception of an internal sense, and we specify the type of 'perception of an internal sense' by identifying the internal sense as our moral sense.
In this section of the Treatise, Hume is arguing against the abstract relation theory, just as in the next section he will argue for the moral sense theory. Given the philosophical lay of the land, of course, the two go together. As Hume says at the very beginning of 3.1.2, summing up 3.1.1 and transitioning into 3.1.2,
Thus the course of the argument leads us to conclude, that since vice and virtue are not discoverable merely by reason, or the comparison of ideas, it must be by means of some impression or sentiment they occasion, that we are able to mark the difference betwixt them. Our decisions concerning moral rectitude and depravity are evidently perceptions; and as all perceptions are either impressions or ideas, the exclusion of the one is a convincing argument for the other.
In other words, another way of putting the argument is to say that in 3.1.1 he is arguing that we do not discover vice and virtue, right and wrong, by comparing ideas; in 3.1.2 he will argue that we sense or feel them directly. Hume locates himself clearly in the moral sense camp.
In the next section I will move on from content in order to look directly at the argument in the is/ought passage. But already the reader should begin to see why the conclusion we are supposed to draw from the argument is "that the distinction of vice and virtue is not founded merely on the relations of objects, nor is perceiv'd by reason."