Why is the z direction away from the screen/viewer? I wonder what is the reason that when z increase, the objects appear far away and when z is negative, the object is behind the camera?
If you want to use the traditional x is towards right and y is up you are used to in math and physics classes. Now if you follow a right handed coordinate space, which is also commonly used. Then the direction of the z follows from the x and y direction.  In this sceme positive z is pointing out from the screen.

Now you can also choose a left handed coordinate system in which case the z is reversed. Its just a matter of choosing which convention you want to use. 

Likewise if you choose y to be down, ala traditional windowing math then z is reversed even if you use right hand rule.

None of these conventions are set in stone you can do whatever you want. A bit like you can choose row major or column major matrixes. You just need to know what comvention you follow.