As we know that iron have high permeability, therefore it will provide easy path for the magnetic field lines to pass. As a result of this, all the magnetic field lines of earth's magnetic field will prefer to pass through the wall of the box making magnetic field inside the box zero. Hence, it will keep the valuable instruments away from the earth's magnetic field.