Scalping only exists because there's a difference between what the tickets cost and what the fans value them at.
For popular shows, there are more people who want to see the show than there are tickets available, so you need to pick a strategy for deciding who's going to go.. Ticket sellers have to balance lost profits from lower prices, prices being too high and the show not selling out, and fans being furious at the artist for making the tickets unaffordable for most of the true fanbase.
Dynamic pricing (airline style) and auction-based systems basically ensure that only the rich can attend. Scalping is a way to do price discrimination / progressive pricing. If you're a true fan, you know when the ticket sale will happen ahead of time, and you snatch the tickets quickly. If you're not, but are rich enough not to care, you have to buy from a scalper. Like all discounting and price discrimination strategies, it sometimes backfires; if you're a true fan attending your mother's funeral when the sale opens, you'll have to pay the rich person's price.
You can also see scalpers as being awarded by capitalism for taking risks. They make sure the show sells out and the artist is happy, even if fan interest is lower than expected. In such a case, they take on the losses, if all goes well, they take some of the profits from the sales.