For the peacock, there is an evolutionary explanation. The male plays no role in raising the chicks. He is only there to supply sperm. As such, the flock only needs one exceptional male.
To have survived with such an ungainly tail, he had to be exceptionally strong, fast, and disease-resistant. Those genes will be passed along to his daughter chicks. The pea hen is looking for the male who will give her the most-fit daughters.