Is it any crime, after a shipwreck, to seize whatever means or instrument of safety one can lay hold of, without regard to former limitations of property? (III.I.8)
There's no doubt that justice is an important social virtue. Where'd we be without it? Well, we only have to look at a situation such as a shipwreck to get a taste of a justice-free world. When justice breaks down, self-preservation takes hold and it's dog-eat-dog (just check out Lord of the Flies).
Suppose that several families unite together into one society, which is totally disjoined from all others [...] But again suppose, that several distinct societies maintain a kind of intercourse for mutual convenience and advantage, the boundaries of justice still grow larger, in proportion to the largeness of men's views, and the force of their mutual connexions. (III.I.21)
As this quote shows, society isn't something that just springs up overnight. It's much more gradual and starts out on a small scale with families/small groups thinking "hey, how about we work together?" As time goes on, the network gets wider and, lo and behold, we have a fully-fledged society. If people didn't find it useful, it wouldn't have a reason to exist.
Sometimes the interests of society may require a rule of justice in a particular case; but may not determine any particular rule, among several, which are all equally beneficial. In that case, the slightest analogies are laid hold of, in order to prevent that indifference and ambiguity, which would be the source of perpetual dissension [...] Many of the reasonings of lawyers are of this analogical nature, and depend on very slight connexions of the imagination. (III.II.10)
Justice may be clear-cut in some cases but this isn't always how it goes. Sometimes, we may know that some kind of rule is needed but we're not sure exactly what it should be. It could be that various rules would fit the bill, so how do we decide which to pick? There's no simple answer to this, so folks may find themselves clutching at any analogy that fits the bill and puts an end to all the confusion and debate.
In general we may observe that all questions of property are subordinate to the authority of civil laws, which extend, restrain, modify, and alter the rules of natural justice, according to the particular convenience of each community. The laws have, or ought to have, a constant reference to the constitution of government, the manners, the climate, the religion, the commerce, the situation of each society. (III.II.13)
As well as the big, country-wide laws, communities can set up other rules that they find convenient. Still, we have to remember that communities exist within society rather than apart from it. This means that folks should keep in mind the government and the laws of society (rather than just doing whatever they please).
It may appear to a careless view, or rather a too abstracted reflection, that there enters a like superstition into all the sentiments of justice; and that, if a man expose its object, or what we call property, to the same scrutiny of sense and science, he will not [...] find any foundation for the difference made by moral sentiment. I may lawfully nourish myself from this tree; but the fruit of another of the same species, ten paces off, it is criminal for me to touch. The same species of reasoning it may be thought, which so successfully exposes superstition, is also applicable to justice. (III.II.16)
Justice and superstition may not seem to have much in common at first: one conjures up weird, mystical stuff while the other makes us think of laws and court rooms. Sure, folks may see superstitions as primitive (e.g., not eating a certain kind of meat on a particular day), but justice can be viewed as random too (e.g., why can we take fruit from a tree near us but one only a short distance away is forbidden?). We're used to rules of this sort, but, let's face it, there's nothing natural or inevitable about them.
But there is this material difference between superstition and justice, that the former is frivolous, useless, and burdensome; the latter is absolutely requisite to the well-being of mankind and existence of society. When we abstract from this circumstance [...] it must be confessed, that all regards to right and property, seem entirely without foundation, as much as the grossest and most vulgar superstition. (III.II.17)
Though superstition and justice appear to work in a similar way sometimes (and can seem equally random), Hume argues that there is a big difference: superstition is silly and useless while justice is a vital social structure. If we overlook this then, yeah, justice seems like another kind superstition.
The necessity of justice to the support of society is the sole foundation of that virtue; and since no moral excellence is more highly esteemed, we may conclude that this circumstance of usefulness has, in general, the strongest energy, and most entire command over our sentiments. It must, therefore, be the source of a considerable part of the merit ascribed to humanity, benevolence, friendship, public spirit, and other social virtues of that stamp; as it is the sole source of the moral approbation paid to fidelity, justice, veracity, integrity, and those other estimable and useful qualities. (III.II.27)
We keep coming back to the same theme: usefulness. The above quote sums up the importance of this quality and how big a role it plays in our lives. Just take a look at the virtues that Hume lists. They're all valuable and they're all pleasing but they have something else in common. Yep, they're all useful (if Hume guested on Sesame Street, this would definitely be the word of the day).
It is indeed observable, that, among all uncultivated nations, who have not as yet had full experience of the advantages attending beneficence, justice, and the social virtues, courage is the predominant excellence; what is most celebrated by poets, recommended by parents and instructors, and admired by the public in general. (VII.15)
We know that justice and the other social virtues are valued in the society we live in today. But, if we step outside modern, industrial society, we find that this isn't always the case. What about primitive societies and nations that aren't fully civilized? Here, different values are seen as useful, with courage being the cream of the crop.
When Oedipus killed Laius, he was ignorant of the relation, and from circumstances, innocent and involuntary, formed erroneous opinions […] But when Nero killed Agrippina, all the relations between himself and the person, and all the circumstances of the fact, were previously known to him; but the motive of revenge, or fear, or interest, prevailed in his savage heart over the sentiments of duty and humanity. (AI.12)
Okay, so crimes don't come much more serious than murder, but juries still have to weigh up the motive. In some cases, we're dealing with cold-blooded murder driven by revenge, self-interest, or all sorts of ridiculous reasons. In other cases, though, the killer may be ignorant of how things really are. Both are serious acts, but, using examples from mythology, Hume highlights the difference between making a big mistake and being a whacked-out murderer who's lost any sense of humanity.
[…] The case is not the same with the social virtues of justice and fidelity. They are highly useful, or indeed absolutely necessary to the well-being of mankind: but the benefit resulting from them is not the consequence of every individual single act; but arises from the whole scheme or system concurred in by the whole, or the greater part of the society. (AIII.3)
Justice and faithfulness are useful values for society but they don't work on an individual level like some other virtues. Kindness, love, and loyalty may be important in one-to-one relationships or in smaller groups, but justice is a much bigger thing. It depends on rules that are set up to keep society running smoothly and ensure that everything's A-Okay.