It's hard to say. A zoo is a kind imprisonment which is never a good thing, at the same time zoos are improving over time trying more and more to seek the balance between visitor's satisfaction and animal welfare.
The point is that zoos do play an important role in education. The only way to truly learn about animals is by meeting them, and a zoo makes that possible in a relatively safe way (if you've heard of the Bokito incident in the Netherlands, you know it's never 100% safe and that incidents can still happen, especially when you provoke animals, which was that case in the Bokito incident, but overall, yeah).
( https://en.wikipedia.org/wiki/Bokito_(gorilla) )
Zoos also play a more and more important role in animal care in the world and the protection of endangered species.
Zoos themselves are also faced with this question themselves. People who work there and especially the caretakers of the animals do this out of a great love for animals, and they are therefore well aware of the situation the animals are in. Zoos are improving a lot on this particular field. There is also more and more recognition that animals do have a mind and conscience and they too are vulnerable to stress and depression.In the past they thought all animals merely acted by instinct and that humans were the only really sentient species (shows how arrogant we are), and looking at the zoos of the past I guess that shows a little. Now that we know better we can see the attitude change as well in the way zoos are designed.
Ultimately the wild is always the best place for them, however zoos do something important and the nasty truth is that some species are only still in existence thanks to zoos.
Therefore this is one of those questions I cannot give a definite answer to.