It's obviously an unfortunate situation that played out, and there's probably some blame to be given to both the parents, for not being more careful with their youngster, and the zoo, for not having better security measures (IE: better enclosures, tighter railings, etc.. so that children couldn't get in so easily)
However, in terms of the response, it's a no brainer in terms of the decision to shoot the gorilla...it's a 400 pound animal that could, quite frankly, rip the limbs off of a regular human. (especially a youngster like that).
My stance is that if it's "person vs. animal", you opt to help the person 10 times out of 10. (at least that's my opinion).
On the topic of Animal Captivity, I'm really torn on that issue. As
@Mountain_Girl406 mentioned, captivity and close interactions with humans aren't the natural condition of most of these animals. ...on the other hand, captivity has been necessary for the advancement of the zoology, veterinary, and biological sciences... and the advancements of those 3 fields would certainly take a blow if we completely eliminated all forms of animal captivity.