If you were to release the animals in zoos into the wild, they'd meet with the same circumstances that made their species endangered. In the civilised world, zoos exist primarily to conserve wildlife - London and Whipsnade, for example, contribute 10-20% of their turnover to wildlife conservation programmes (which I think represents all of their profit). Their animals are kept in good conditions, and for that matter good condition - animal life expectancy is vastly higher in a decent zoo. They're kept exercised, and the keepers do what they can to provide the best quality of life for them. Breeding programmes avoid inbreeding (which in some cases is crippling wild populations - eg. the jaguar and lion) and increase the population away from poaching, starvation and disease. The public exhibitions are there to provide the funding necessary to keep the animals (and as mentioned for field conservation work); Whipsnade spends £1 million a year just on food for the animals. Only an oligarch could afford to keep a private collection for any length of time.
Regarding taking animals out of the wild to put in zoos - any decent zoo does not do this, and won't accept animals which were obtained that way, which is usually illegal. It's actually illegal even to breed endangered species outside established breeding programmes, in which every animal's history and parentage is accounted for.
Getting back to the release of endangered animals into the wild, as I touched on earlier, in most cases it's counterproductive as the circumstances that caused them to become endangered are still in place. Wildlife preserves are too far apart to allow the intermingling of populations, resulting in inbreeding. Poachers run unchecked in poorer regions. Diseases like TB or chytrid infection can't be guarded against. When conditions alleviate, zoos often run programmes to reintroduce captive populations back into the wild. In my opinion, if anything they're too eager to do this - even if a Siberian tiger is successfully acclimated to fending for itself, the wild population of that species is almost certainly screwed. The future for them relies on building their numbers in a safe environment.
As for unregulated zoos, of the kind you particularly hear about in Asia, I can't really comment, I don't have experience. Chances are, any zoo you've actually visited in the last couple of decades will be ethically sound and run by people who genuinely care about their charges, both in captivity and in the wild.