To analyze the mental health and erectile function status of men using sperm donor during pregnancy after ICSI failure in severe oligoasthenospermia and to provide reference for clinical implementation of more targeted psychological intervention and nursing for this group. A total of 410 sterile men who received assisted pregnancy treatment in our hospital from December 2020 to December 2022 and met the inclusion and exclusion criteria were collected as the study subjects. Among them, 68 patients with severe oligoasthenospermia who used donor assisted pregnancy after ICSI failure were used as the study group. Sixty-eight patients with severe oligoasthenospermia who continued to receive ICSI assisted pregnancy were matched by propensity score 1:1 as control group. General data questionnaire, self-rating Anxiety Scale (SAS), self-rating Depression Scale (SDS), Chinese version of perceived Stress Scale (CPSS) and International Erectile Function Index Rating Scale (IIEF-5) were used to conduct a cross-sectional investigation to compare the mental health and erectile function status of the two groups. There were statistical differences in age and occupational status between the two groups before PSM (P < 0.05), but there was no statistical significance in social demographic data between the two groups after matching (P > 0.05). The incidence of anxiety, depression, stress and erectile dysfunction (ED) in the study group was higher than that in the control group, and there were statistical differences between the two groups (P < 0.05). The use of donor sperm to assist pregnancy has a great impact on the mental health and erectile function of infertile men. Medical personnel should pay attention to the mental health and erectile function of these men, and formulate targeted measures to help these patients actively cope with infertility, so as to improve the life and marriage quality of this group and improve their mental health status.