Floods can cause masonry buildings to become immersed for a long period of time, which causes the building materials to deteriorate and thus affects the safety performance of the structure. In this study, a long-term-immersed masonry wall was considered as the research object, and a cohesive element containing damage evolution was used to simulate the mortar layer, establish a finite-element model of the separated masonry wall, and perform numerical loading experiments. Data on the crack width variation in the masonry walls were extracted using Python. The effect of a long-term-water-immersion environment on the shear performance of masonry walls was analyzed considering material deterioration. The results show that long-term flooded masonry walls are characterized by low shear capacity and low stiffness, and safety reserves cannot be guaranteed. A partially immersed masonry wall is prone to damage from the weak parts and has a high risk coefficient. The macro damage degree of a masonry wall immersed by a flood is not as serious as that of the original wall in the early stage, but it suddenly increases in the collapse stage, and the warning effect of cracks is reduced, which requires special attention in safety assessments.