Genetic diversity in populations is very important. It helps increase their chances to be able to respond to changes in the environment. Populations with little genetic diversity are those that are at the highest risk of decline and extinction. The reason that genetically diverse populations are more resilient to environmental impacts is because it is more likely that they may have individuals who can withstand and survive it and pass those traits to their offspring.
Having a variety of different traits within a population is advantageous for its survival because selective pressures could change (usually linked with the state of the ecosystem/environment). A condition that was previously deemed “advantageous” could be harmful under new environmental conditions. The allele would then, theoretically, be selected against, and the numbers of individuals carrying that gene would begin to decrease.