The two moment forces acting in the $y$ direction get canceled. Why? If the magnetic dipole (the square loop of current) turns a bit around the $y$ axis, two forces to the $x$ axis will exert a moment and return it back to order. But if it turns a bit around the x axis, wouldn't the two forces to the $y$ direction also exert a moment and turn to turn it back to $\phi =0$? Is it usually said this way when we talk about a specific rotation and then the other forces are not relevant to the torque?
Of course, if you tilt the square loop around the $x$ axis, the pair of forces which tend to re-align the loop with the initial plane (yellow plane in the figure) are those on the $y$ direction, and the forces on the $x$ direction just tend to deform the loop, not exerting any torque on it. The reason for this is that when you tilt the loop like in the image, the forces on the $y$ direction (considered in the middle point of the side of the loop$ are parallel to the position vector, when you define it like in the picture, so that torque is null, for it involves a cross product of the force and the position.