Hint: It must have both spin and electrical charge for an elementary particle to have an inherent magnetic moment. There is spin on the neutron, but it has no net charge. The neutron consists of three quarks, and these elementary particles' magnetic moments combine to give the neutron its magnetic momentum.
Complete answer: The protons, cathode rays and alpha particles are charged particles, so the magnetic field deflects them. But there is no charge on the neutrons, so they are not deflected by the magnetic field. A neutron affected by a field of magnetism. The neutron has a magnetic moment not radically different from that of a proton thanks to its internal structure (3 quarks), so its spin will prevail in a magnetic field just like in NMR. There is no total electric charge in a neutron, so its trajectory is not affected by a uniform magnetic field, but it has a magnetic moment, and this magnetic moment can interact with the external field, resulting in changes in the direction of the spin of the neutron. And the trajectory of a neutron may also be modified by a non-uniform field.
Note: Neutron stars are magnetic because they contain powerful electrical currents in their interiors. Due to magnetic fields, the Zeeman effect is the division of atomic lines. However, neutron stars have such enormous magnetic fields that the structures of the atoms on the surface are modified. The neutron is unable to decay without a source of this extra energy. Hence, the neutron is stable in a deuteron. The decay of free neutrons is feasible for energy because a neutron's mass is greater than the sum of the proton and electron masses it decays.