Erectile dysfunction is not related to the ability of a man to ejaculate (ejaculation), just as a good erection does not mean good quality sperm. Source - https://www.aawhworldhealth.org/news/
It is a persistent inability to perform sexual intercourse due to insufficient tension in the penis. Such a diagnosis can be made if a man is not able to maintain an erection in at least 1 of 4 sexual acts.
Causes of impotence (erectile dysfunction)
diabetes mellitus, causing neuropathy;
hypogonadism (decrease in testosterone levels due to dysfunction of the pituitary or testicles);
problems with the vessels of the penis;
lesions of the cerebral cortex and located in it centers of regulation of sexual functions;
some drugs: against high blood pressure, psychotropic, some anti-cancer drugs, estrogens.