Mesh does not stay flat against same degree mesh when rotating on x-axis
The arm is rotating as expected, the apparent problem lie in the fact that the plane of arm joint is not perpendicular to X axis, it is slightly inclined toward it.

The behavior you are expecting can be achieved by rotating around an axis that is perpendicular to the arm joint, it happened that the local space of arm is aligned with the plane of the arm joint, so rotating around the local Z axis of the arm will achieved what you want. Simply change to Local Transform Orientation and rotate by using R >> Z + Z.



Let us, however, assume that the local space of the arm is not aligned with the joint. We can then create a local space manually and rotate around it. A possible way to do it is by adding an empty that is perpendicular to the joint's plane, this can be done by aligning the view to the faces of the plane of the joint and adding an empty using the Align to view option. Parent the object to the empty and rotate around it's local Z axis as explained above.