Although third-line antiretroviral therapy (ART) is available in South Africa's public sector, its cost is substantially higher than first and second line. Identifying risk factors for failure on second-line treatment remains crucial to reduce the need for third-line drugs. We conducted a case-control study including 194 adult patients (≥18 years; 70 cases and 124 controls) who initiated second-line ART in Johannesburg, South Africa. Unconditional logistic regression was used to assess predictors of virologic failure (defined as 2 consecutive viral load measures ≥1000 copies/mL, ≥3 months after switching to second line). Variables included a social instability index, ART adherence, self-reported as well as diagnosed adverse drug reactions (ADRs), HIV disclosure, depression, and factors affecting access to HIV clinics. Overall 60.0% of cases and 54.0% of controls were female. Mean ages of cases and controls were 41.8 ± 9.6 and 43.3 ± 8.0, respectively. Virologic failure was predicted by ART adherence <90% [odds ratio (OR) 4.7; 95% confidence interval (95% CI): 2.1-10.5], younger age (<40 years of age; OR 0.6; 95% CI: 0.3-1.1), high social instability (OR 3.8; 95% CI: 1.30-11.5), self-reported ADR (OR 1.9; 95% CI: 1.0-3.5), disclosure to friends/colleagues rather than partner/relatives (OR 3.4; 95% CI: 1.3-9.1), and medium/high depression compared to low/no depression (OR 4.4; 95% CI: 1.5-13.4). Our results suggest complex socioeconomic factors contributing to risk of virologic failure, possibly by impacting ART adherence, among patients on second-line therapy in South Africa. Identifying patients with possible indicators of nonadherence could facilitate targeted interventions to reduce the risk of second-line treatment failure and mitigate the demand for third-line regimens.