Background and Objectives: Erectile dysfunction is a significant problem, which diminishes the quality of life. The aim of this study was to investigate the relationship of childhood trauma and attachment styles in the aetiology of psychogenic erectile dysfunction. Materials and Methods: The study included 80 participants (40 patients who presented with the complaint of erectile dysfunction, were not determined with an organic pathology, and were diagnosed with erectile dysfunction according to the DSM-5 criteria; and a control group of 40 healthy subjects.) The structured clinical interview form for DSM-5 (SCID-5) was applied to all the participants, together with the International Erectile Function Index (IIEF), the Childhood Trauma Questionnaire (CTQ), the Relationship Scale Questionnaire (RSQ), and the Beck Depression Inventory (BDI). Results: The emotional abuse (p = 0.002), physical abuse (p = 0.049), emotional neglect (p = 0.004), physical neglect (p = 0.002), and total scale points of the CTQ were determined to be significantly higher in the patient group than in the control group. Secure (p = 0.022) and dismissive (p = 0.009) attachment styles were found to be higher in the control group. As the time together with the current sexual partner increased, so the severity of erectile dysfunction increased, and sexual function, orgasmic function, sexual satisfaction, and general satisfaction decreased. As emotional abuse, sexual abuse, and physical neglect increased, the severity of erectile dysfunction increased. Childhood trauma (β = -0.275, t (73) = -2.704, p = 0.009) and the duration together with the partner (β = -0.249, t (73) = -2.512, p = 0.014) were found to be predictive of erectile dysfunction. Conclusions: The results of this study demonstrated that childhood trauma and the time elapsed without treatment are predictors of psychogenic erectile dysfunction severity, and secure attachment style and self-esteem play an important role in the aetiology of psychogenic erectile dysfunction.