Because a single pant, or pantaloon, is a garment covering only one leg. They used to be used in pairs, thus forming the pair of pants.
At some point, clothing sales realised that nobody bought single pants, so they started to be exclusively sold as pairs. And because it's far more convenient to fabricate it as a single item, they only exist as one item today, called a "pair of pants". Because they are, at their core, two pants sewn together.
It’s the weird grammar rules of English at work. Maybe because each part that covers your keg could technically be considered a “pant,” and because we have 2 legs, if that’s the case, then I guess I could say it makes perfect sense for them to be called a pair of pants (unless you aren’t from North America and usually when you say or hear “pants,” you think of underwear instead).
Pantaloons consisted of two pieces.