Suppose there are 1000 tickets for a show that are $20 each. There are 5000 people in town who would buy a ticket at that price. Without any scalping, the first 1000 people who show up get a ticket and 4000 people go home unhappy.

With scalping, the first 1000 people who show up still get tickets. 900 of them are scalpers. (So if you were in the first 100, you still got to pay face value.) I'm being very generous with this scenario--I've personally never seen a situation where this was a real problem, as I've gone to every ticketed event I've ever wanted to paying face value.

The 900 scalpers all pick different prices. At $40, there are about 2000 people left in town who want to buy a ticket. Some of them get tickets, but the other scalpers get wise and think, why not charge more? So they charge $50. Or $60. Eventually they reach a point where there are exactly n tickets left, and exactly n people left in town who are willing to buy at that price. If the scalpers overprice the ticket, no one will buy, so they'll need to lower the price again. But generally, what's reached is a fair price that sees all the tickets go to people who actually were willing to buy them at the price they bought them at.

So let's look at what's happened. Without scalping, you have 4000 people who missed out on buying tickets because they weren't first in line and 1000 people going to a show. With scalping, you still have 1000 people going to a show, but instead of all of them being picked on the less-than-perfectly-fair basis of who was first in line (which is a disadvantage to people with more work, more responsibilities, inconveniently timed emergencies, and slow internet connections), some of them are picked based on who was first in line, and some of them are picked based on who was willing to pay more (which is a disadvantage to people with less money).

You might think, well, it's better to be unfair to busy people than to be unfair to poor people. But let's change this thought experiment and say the face value of the tickets was $60 to begin with instead of $20, and at $60, there are exactly 1000 people in town who are willing to buy a ticket. Now there are no scalpers (or if any scalpers do show up, they can only resell the ticket for face value anyway). I would argue that this scenario is strictly less fair than the scenario where the face value was $20 and there was some scalping, because at least in the first scenario, it was possible to get a lower price by getting in line first!

Fundamentally, what difference does it make who's setting the price? You might say, well, if the face value was $60, at least the performer (or the venue, or the ticket vendor) is getting the extra money, not just some "scalper". But the scalper is effectively getting in line for you. He's going out of his way to do the leg work for you. You know who else we pay a premium to for doing the leg work? Shopkeepers. Sure, if we really wanted to, we could go to some warehouse and save some money by buying all our stuff off a pallet. (You still can if you want to--it's called Costco.) But maybe I'd rather some other guy does all that legwork for me, and in exchange, I'll pay more. And if you're running around doing legwork for other people, you are benefitting those people.