It's not clear why the author chose to calculate the moment of inertia (MOI) about both axes, since there is a loading applied to this beam in only one direction. My guess - the author wanted to illustrate how the calculation changes when different axes are used.
The MOI used by the author to calculate bending stress is greater about the x-x axis because the T-section is deeper than the top flange is wide. Therefore, orienting the T so that its deeper dimension is parallel to the plane of the applied load will produce a beam having the maximum strength, and consequently, the lowest bending stresses.
This article explains how the MOI is calculated and how it is related to finding the bending stress in a beam:
http://adaptivemap.ma.psu.edu/websites/moment_intergrals/rectangular_area_moment_of_interia/rectangularareamomentofinteria.htmlNot necessarily.
The cross section of the beam is a plane, and typically the axes of this plane are assumed to be x-axis parallel with the neutral axis, and the y-axis is vertical, or otherwise noted in the problem statement.