Externalities, Regulation, and Silver Mining
To start, let's look at an example that I used (unsuccessfully) in a law school application essay. Let's say you are running an early colony in North America. To keep things simple, assume that people can engage in two activities: they can farm, or they can search for silver. (Early colonists in Massachusetts thought they would find silver there. Let's assume you don't have an opinion on whether or not there is silver—you are, at least, open to the possibility.) And let's assume that farming involves a certain amount of randomness (so for instance, you don't know exactly how much corn a field will produce, but you have a sense of the range of probable outcomes). Your colony is small, but big enough that using money (in this case silver) helps the market clear. Accordingly, colonists have brought along a few dozen pounds of silver. And finally, assume that there won't be any external trade for a long time. Ships might show up, but only to drop off more colonists.
Now, from a social perspective, time spent searching for silver has approximately no value. This is because adding to the colony's stock of silver doesn't accomplish anything. It's important to have some quantity of silver (because money clears the market better than barter does), but the colony already has plenty of silver for trading purposes. Adding to the stock of silver simply results in a higher price level, which has mostly secondary effects that are not necessarily positive. (For any given price level, there is a certain amount of silver that people have to carry in order to transact in the market. If the supply of silver grows too large, leading to high prices, then it becomes burdensome to carry around the required amount of silver. On the other hand, if silver becomes too valuable, it may become difficult to sub-divide it into small enough increments to trade. However, because silver is so soft, and because it can easily be melted back together, it can be divided into very small pieces if necessary.)
Meanwhile, the less farming that gets done, the higher the probability that the colony will starve. Now it's true that we would generally expect there to be some farming no matter what, since food itself is a valuable commodity, and it is increasingly valuable as it becomes scarce. In the extreme case, if only one colonist farms, then he can demand an arbitrarily large amount of silver in exchange for his food. (Assuming the other colonists don't simply take the food under the guise of "necessity" or "emergency" or something. Let's say the political system doesn't allow for that outcome.)
So there will be farming. But will there be a socially optimal amount of farming? I think you can pretty easily come up with numbers that would give you the answer "no." This is because, as I mentioned, searching for silver has approximately no social value. In fact, if you think about it, searching for silver is mostly about redistributing existing wealth, not creating wealth. Let's say the colony starts with 50 pounds of silver, distributed among the colonists (some hold more, some hold less, but everyone needs a certain amount of silver to do business). Only one colonist searches for silver, and he finds 50 pounds of it. Now prices will (roughly) double, and so most colonists will have lost half the value of the silver they happen to be holding. But the colonist who found the silver will now have wealth equal to approximately half of the colony's economy. No value has been created, it has simply been re-allocated from the farmers to the prospector.
And so we can see that it would be possible to make the colony better off by forbidding colonists to search for silver. Alternatively, the colony could levy a tax on prospecting, or a tax on purchasing food. Exactly which regulation is best depends on the circumstances (for instance, how easily can colonists observe each others' behavior?). But in any case, it's easy to see that there is a possibility for welfare-improving regulation even though there is no obvious externality. (If you have a liberal definition of "externality" then you can probably find one here, although by the same token a liberal definition of externality will justify a high level of regulation in the modern economy.)
The larger lesson here is that the government must structure the marketplace to serve social needs. Eliminating wasteful activity is a socially valuable thing even if there are no obvious externalities to be combatted. This is the logic behind things like bankruptcy law, securities regulation, taxi regulation, and even things like safety regulation. Just to spell it out a little: bankruptcy law is intended to prevent a wasteful "race to the courthouse" as creditors try to seize the debtor's assets. The problem is that the first creditor to get a lien and foreclose on the debtor's property might get 100% of what he is owed. But that just leaves fewer assets for the other creditors, and if the first creditor seizes something important (like a car or tractor), he might eliminate the debtor's ability to earn income and repay other creditors. The last creditor to show up might get nothing. An early creditor is a bit like a silver prospector, in that he draws wealth from a common pool. And what really matters is not the absolute time at which a creditor levies on the debtor's property, but the time relative to other creditors. So there is an arms race, and it might be rational to spend quite a bit of money (for instance, in legal fees) to be the first, even though it's hard to see a social benefit resulting from all that haste. Bankruptcy law addresses this problem by freezing most creditor remedies and bringing recent payments back into the general pool to be distributed equally among creditors.
So anyway, long story short, it doesn't make much sense to take an "externalities only" approach to law and regulation, unless you define "externality" so broadly that you can regulate just about anything.