Most Zoos around the globe have signed up to conservation programmes, in part to justify their continued existence. The thinking behind this is that zoos would act as a repository for those species that might be endangered in the wild, with the prospect of re-seeding the particular species if necessary.
So part of that will be attempting to ensure that the genetic profile does not move too far away from the "norm", as represented by the species in the wild. Since Zoos generally cannot hold large numbers of animals, particularly larger species, like Giraffes, or Hippos ,or Zebras, or the big cats etc, and often such groups are family groups, there is the prospect of significant in-breeding, leading to declining reproductive success and lifespan of the creatures in question. So they need to ensure genetic biodiversity.
Mostly they do this by swapping out animals from one zoo to another, but sometimes such a swap is not possible, so an animal in captivity will be put down rather than allowed to breed.