Except at the equator the magnetic field lines run with an inclination
into the ground if one follows them to north or south - depending on
the hemisphere.
Most magnetic bacteria react chemotactically to oxygen. When they follow the magnetic field lines, they can easily move into the deeper anoxic or upper oxic sediment layers.