Human Immunodeficiency Virus (HIV) remains a major public health problem, particularly among men who have sex with men (MSM), who are at increased risk of infection. Various cognitive, psychosocial, social, and behavioral factors may influence HIV incidence in this population. This study aimed to analyze the determinants of HIV infection among MSM at Anutapura Regional General Hospital, Palu, Indonesia. This study used a quantitative analytical design with a case–control approach. The population consisted of MSM who underwent HIV testing or received HIV treatment at Anutapura Regional General Hospital during 2023–2025. A total of 126 respondents were included, comprising 63 HIV-positive MSM as cases and 63 HIV-negative MSM as controls. HIV-positive participants were selected using total sampling, while HIV-negative participants were selected using purposive sampling. Data were collected through structured questionnaires and medical records. Independent variables included knowledge, vulnerability, concern, social life, and preventive actions. Data were analyzed using multivariate logistic regression. The results showed that vulnerability was significantly associated with HIV incidence (p = 0.001; OR = 3.76; 95% CI: 1.74–8.15) and was the most dominant risk factor. Concern toward HIV acted as a protective factor (p = 0.032; OR = 0.41; 95% CI: 0.18–0.93). Knowledge, social life, and preventive actions were not significantly associated with HIV incidence. In conclusion, vulnerability is the main determinant of HIV infection among MSM, while concern toward HIV plays a protective role. These findings indicate that HIV prevention programs should focus on reducing vulnerability through behavioral interventions, improving access to health services, and strengthening psychosocial support for MSM populations.