
Background Opioid use disorder remains a significant public health burden in Iran. While methadone maintenance treatment (MMT) is effective, its success is often limited by high attrition rates. Most protocols emphasize pharmacological factors, neglecting the multifaceted biopsychosocial nature of treatment retention. Methods This prospective longitudinal cohort study involved 342 men with opioid use disorder from 10 public and private treatment centers in Iran. Path analysis with diagonally weighted least squares (DWLS) was used to evaluate biological, social, and psychological predictors of six-month treatment retention. Results The biopsychosocial path model demonstrated favorable fit (Scaled CFI = 0.966, Scaled TLI = 0.923, Scaled RMSEA = 0.061, Robust SRMR = 0.041). Full-time employment (beta = 0.35, p < 0.001), participant age (beta = 0.12, p = 0.032), and methadone dose (beta = 0.26, p < 0.001) were significant positive factors associated with retention. Global psychological distress (beta = -0.36, p < 0.001) negatively predicted retention and significantly mediated the effects of social and biological factors. Criminal history primarily influenced retention indirectly by increasing psychological distress and exhibited a significant negative direct effect (beta = -0.22, p < 0.001). Conclusions MMT retention is determined by the interplay of social stability and psychological health. Integrating vocational rehabilitation and routine mental health screening for global distress into clinical protocols is essential for enhancing treatment persistence and reducing dropout rates.