The ethical dilemma of euthanasia presents a significant challenge in medical practice. The attitudes of medical students toward euthanasia can be shaped by a variety of factors, such as their personal beliefs, values, and personality traits. This study explored the intricate relationship between personality traits, as outlined by the model, and medical students’ attitudes toward euthanasia, with a particular focus on the potential moderating effect of spiritual intelligence. In this cross-sectional study, 219 medical students from Zahedan, Iran, including 85 males and 134 females, were selected in 2022 using a non-random convenience sampling method. Participants provided socio-demographic information, including age, gender, and medical degree. They were also evaluated using the spiritual intelligence self-report inventory, the 24-item brief HEXACO inventory, and the euthanasia attitude scale (EAS). Data analysis was conducted using SPSS software version 29 and included both descriptive statistics (frequency, mean, and standard deviation) and inferential statistics (independent t-test, analysis of variance, Pearson correlation coefficient, and hierarchical linear regression). The findings revealed a significant positive correlation between the personality trait of openness to experience and favorable attitudes toward euthanasia. In contrast, there was a negative correlation between EAS scores and spiritual intelligence, as well as the honesty-humility dimension of personality. Furthermore, regression analysis indicated that spiritual intelligence moderated the relationship between EAS scores and the associated personality traits. The study underscores the importance of understanding how HEXACO personality traits and spiritual intelligence influence medical students’ attitudes toward euthanasia. This insight is vital for medical educators and policymakers in creating educational programs that foster critical thinking, empathy, and ethical decision-making in future healthcare professionals. Additionally, this knowledge can guide the formulation of euthanasia policies that respect the diverse viewpoints and values within the medical community.