He likely didnt pull it out from his socket on purpose, I think he more than likely got it terribly damaged by a scratch, and since he already had an infection, (those can sometimes cause increased ocular pressure pushing the eye outwards), add the scratch to it, and he loses an eye.

Maybe next time something like that happens, seek medical help, as any infections in the eyes are extremely painful.