Zoos are a conundrum – but keep in mind that their purpose has been slowly growing and evolving. While they began as sheer entertainment (sometimes disguised as education), they have been gradually moving toward active participation in conservation and breeding programs. They have become a significant force in the preservation of some keystone species. They have also begun to focus more on quality of life of the animals on display, more natural habitats (rather than just diaramas painted onto the back of a conrete cage), and behavioral enrichment.
Of course, ideally, all wildlife would be able to exist in a natural, protected environment in which they evolved. That becomes less and less likely as the predominant specie of the planet continues to breed uncontrollably.