Magnetostrictive materials have broad application prospects in sensing, control and energy and information conversion. Improving the performance and application of such materials has become a research hotspot, but defects will inevitably appear in the preparation and use of materials. In this study, the magnetostrictive structure model of iron elemental material without defect, hole defect and crack defect was established by molecular dynamics method. The influence of different defects on the magnetostrictive behavior of iron thin films was analyzed, and the mechanism of the influence of defects on the magnetostrictive behavior was depicted from the perspective of atomic magnetic moment. The results show that compared with the films without defects, the films with 60×2×1 defects in the center are the easiest to reach saturation magnetostriction, and the magnetostriction is the least after reaching saturation. The films with 10×10×1 and 2×60×1 defects in the center require a larger magnetic field to approach saturation, and the magnetostriction of the films with 2×60×1 defects in the center reaches the maximum after saturation. This is because the defects will affect the magnetic moment of the surrounding atoms and make them deflect in the direction parallel to the defects, thus affecting the magnetostriction of the iron thin film. Among them, the hole defects have less influence on the magnetostriction, while the crack defects have more influence on the magnetostriction. The direction of the crack also has an effect on the magnetostriction of Fe thin film. When the crack is parallel to the direction of magnetization, the maximum magnetostriction of the film in the direction of magnetization from the initial state to the saturation of magnetization will decrease. When the crack is perpendicular to the direction of magnetization, the maximum magnetostriction of the film in the direction of magnetization from the initial state to the saturation of magnetization will increase. These results suggest that defects affect the magnetostriction of the model as a whole during magnetization by affecting the initial magnetic moment orientation of the surrounding atoms.