"Let me give you a few examples that illustrate why this mindset is wrong (thinking that piracy should be illegal because it 'hurts sales')."
I like your examples. They illustrate normal activities that probably cause a much greater impact to a particular company's gross revenues than piracy does, and it helps to put things into perspective. Having said that, it does not exactly prove that piracy does "no harm," and I would argue that the producers are indeed made worse off as a result of piracy, which I would define as a sort of "harm" caused to them :-)
In your first example, a person buys (!) media, then convinces N of their friends not to do the same, resulting in the company losing N potential customers. If this person had pirated that media instead (even though we know that they would otherwise have paid for it) and then convinced N of their friends not to buy it, then the company just lost N + 1 potential customers. The difference may be insignificant, but it is certainly non-zero.
The flip side of this example is that the person pirates that media, likes it, then buys it and convinces N of their friends to buy it too. That probably happens less often, though.
In your second example, a person makes the decision to buy their media from XYZ instead of ABC, and ABC loses 1 potential customer. In markets where the product is identical among all sellers, this is a little more relevant; in this instance, not so much. I can't (legally) get Microsoft Office, e.g., from anybody without Microsoft getting a share, so I really only have one "choice": pay Microsoft, or don't use Microsoft Office. If Microsoft charges too much for Microsoft Office, I might go to a competitor that offers a similar product like OpenOffice.org, but that's not the same thing.
Let me give my own example to illustrate when piracy might cause harm to one party, even when there are competitors offering a similar product. For this example, X is a rational consumer who needs office productivity software to do independent contract work, and OpenOffice.org (pretty good, and it's free) and Microsoft Office (better, but it costs $50) are the only two choices; for simplicity, assume that the cost for Microsoft to manufacture another copy of Microsoft Office is negligible (this doesn't change the general outcome of the situation), and Microsoft will not charge any more or any less than $50.
X would be a potential buyer of Microsoft Office if the value that it adds on top of OpenOffice.org is greater than the $50 difference in their licensing fees; let's say that in X's specific case, X would be able to finish a $1200 contract using Microsoft Office in the time that it would take to finish a $1000 contract using the same amount of effort.
X, a rational consumer, receives a marginal benefit of $150 ($1200 - $1000 - $50) buying Microsoft Office, and Microsoft, a rational producer, has a marginal benefit of $50 ($50 - $negligible, $0 for simplicity) to sell Microsoft Office. This transaction does not take place, however, when X pirates Microsoft Office and receives a marginal benefit of $200 ($1200 - $1000 - cost of pirating, $0 for simplicity), and Microsoft gets a marginal benefit of $0.
The only difference between the two scenarios is that X pirates Microsoft Office in one case, and purchases it in the other. Therefore, all of the differences in the outcomes of the two scenarios must be the result of the piracy. Value-added by piracy:
X: $200 - $150 = $50
Microsoft: $0 - $50 = -$50
Because of piracy, Microsoft is harmed by $50, and X is benefited by $50. I will count this as a loss for Microsoft, because X is a rational consumer and would pay Microsoft $50 to gain $200 if piracy were not an option.
Now, to illustrate when piracy might not cause any harm (which may or may not be what you're getting at), let's look at the same scenario with the only difference being that instead of $1200 for the Microsoft Office contract, it's $1020, (and we'll change X's name to Y).
Y would not buy Microsoft Office for $50, because the benefit to doing so is not more than $50; in fact, that decision would result in a marginal loss of $30 ($1020 - $1000 - $50), so Y just uses OpenOffice.org for the $1000 contract. Microsoft would therefore not sell a copy of Microsoft Office to Y, so they are not affected by Y's decision. If Y pirates Microsoft Office, however, Y receives a marginal benefit of $20 ($1020 - $1000 - cost of pirating, $0 for simplicity). Microsoft doesn't lose a customer, because Y would not have bought it anyway. Now, piracy adds to each individual's situation:
Y: $20 - $0 = $20
Microsoft: $0 - $0 = $0
Piracy didn't harm Microsoft at all here (because Y never would have had a rational reason to buy Microsoft Office in the first place), but Y is $20 ahead for it! It's not a huge stretch to imagine Z, who doesn't know anything about piracy, so Z takes the $1000 contract and uses OpenOffice.org to complete it.
It is incorrect to count either of these cases as a loss for Microsoft (since Z used OpenOffice.org instead of Microsoft Office, and Y would not pay $50 to gain $20 in the first place, even though Y used Microsoft Office in the end).
Please understand that I am not completely against piracy. In fact, given a little more in-depth economic analysis, piracy adds an extra $20 to the society described above* (X gains $50, but that is offset by Microsoft losing $50; Y's $20 comes at no loss to anybody, so it's pure gravy**). I think that the enforcement of laws like Hadopi only make situations worse for individuals and ISPs, and the nature of the Internet makes the enforcement itself unreliable. I only take issue with the argument that piracy does no harm [to anyone], because it's really hard to imagine a world where that can possibly be true.
*The "extra" $20 here comes from the assumption that Microsoft will not sell Office for less than $50. I realize that Y would have paid anything in [$0, $20) for Microsoft Office, and if we relaxed the assumption that Microsoft fixes the price at $50, then we can support that Microsoft would sell it for $20, and the extra $20 would go away. I settled on the assumption of a fixed $50 price for Office because it approximates the effect of manufacturing costs, that I hand-waved as "negligible". If manufacturing costs are added in (e.g., $20, where the shelf price of Office is still $50) then what you end up with is that society is actually ahead by between $20 and $40 instead of $20: X's piracy harms Microsoft by $30 and it harms Microsoft's suppliers by whatever their margins are. Y's decision to pirate Office still doesn't cost Microsoft a customer, but now it's because Y will only buy below $20, and Microsoft will only sell above $20, so no sale would be made, assuming Microsoft will not sell at a loss. We assume that Microsoft's suppliers do not operate at a loss or break-even, but their margins must be less than 100%, because they need to purchase raw materials; therefore, their margins are between $0 and $20. X is still up by $50 as a result of piracy, but now Microsoft is only down by $30, and the suppliers are down by $0 - $20, so from piracy, this society now gains: $50 (X's relative gain) - $30 (Microsoft's lost margins) - $(0-20) (Microsoft's suppliers' lost margins) + $20 (Y's relative gain) = "between $20 and $40". In both cases, society's net gain** demonstrates an increase in productivity resulting from piracy, and this gain is higher when margins are lower. This makes intuitive sense: if you pirate something, then the maximum economical benefit you can receive from pirating (rather than buying it) is the unit price. The maximum amount that the company misses out on is their margins, which are always less than the unit price, and usually much less.
**Though, on an individual level, piracy can provide a net benefit to society as a whole, note that producers are harmed, and if piracy is prevalent enough, it can indeed create a situation where a producer no longer has enough incentive to create new innovative products, resulting in a net loss to society far greater than net gains from small-scale piracy.