Bands contain more than one person, so you are paying multiple professionals for their time and work. Many bands only work one event per day, so they're pay is the entirety of what they make on a day, unlike an officiant who can do several events with their time.
You're also paying for their top-quality instruments and sound system, as well as the result of their experience and expertise. Some musicians train for many years, earning a reputation as a stellar wedding performer and in their years of musical education and experience they often play multiple instruments. It takes an entertainment company thousands of dollars to find and train their performers, and trust them with their brand reputation, so these professionals earn higher pay for their performances.
The time of year and day of week factor greatly into the cost of entertainment, with peak season demanding more cost and off-seasons allowing the entertainment company to drop their pricing a bit, at the discretion of the company owner.
Again, you're paying for the band's talent in bringing sensational music to your wedding, high energy, a packed dance floor, great audience reading and interaction, and a non-cheesy welcome into your ballroom. The entertainment is a very important element of a wedding, and your band creates the vibe during the dinner hour as a switch-up from what may be a very different vibe and musical energy at the cocktail party.