Background: Tuberculosis continues to be a major public health issue, particularly in coastal areas where access to healthcare services is often constrained and living conditions differ from inland settings. Treatment failure remains a persistent challenge for tuberculosis control programs at the primary healthcare level. This study aimed to identify factors associated with pulmonary tuberculosis treatment failure in a coastal primary healthcare setting. Methods: An analytical observational study with a case–control design was conducted, involving 48 participants, comprising 24 cases (treatment failure) and 24 controls (treatment success). Data were obtained from tuberculosis program records and through structured interviews. Bivariate analysis using the chi-square test was performed to identify potential determinants (p ≤ 0.25), followed by binary logistic regression to determine factors independently associated with treatment failure. Results: Treatment adherence was the only factor that remained significantly associated with treatment failure after adjustment (AOR = 14.81; p = 0.016). Other variables, including distance to health facilities, knowledge, history of comorbid disease, family support, anxiety, and the role of the treatment supervisor (Pengawas Minum Obat or PMO), did not show significant associations in the multivariable model, although some demonstrated a tendency toward increased risk. Conclusion: Adherence to treatment plays a decisive role in determining tuberculosis treatment outcomes. Strengthening adherence should therefore be prioritized to reduce treatment failure, particularly in coastal communities where structural and social conditions may affect patients’ ability to complete treatment.