The coexistence of diabetes mellitus (DM) and pulmonary tuberculosis (PTB) poses a significant health concern globally, with their convergence presenting a considerable challenge to healthcare systems. Previous research has highlighted that comorbidities can mutually influence and exacerbate immune disorders. However, there is a paucity of data on the impact of DM on immunological features and treatment responses in the TB population in China. From January 2020 to June 2022, 264 cases of pulmonary tuberculosis patients (82 DM patients and 182 non-DM patients) hospitalized in our center were selected. 80 patients with TB with DM (TB-DM) and 80 patients with TB without DM (TB-NDM) were enrolled into the final analysis by propensity score matching for age, gender and involved lung field at a ratio of 1:1. The clinical characteristics, immunological features and treatment response were compared between the two groups. After propensity score matching, no differences in the general features such as age gender, involved lung field, the incidence of retreatment and WBC count were found between the two groups. Compared to TB-NDM group, the TB-DM group exhibited a higher positive rate of sputum smear and incidence of cavitary lesions. Immunological features analysis revealed that the TB-DM patients had higher levels of TNF-α [pg/ml; 8.56 (7.08-13.35) vs. 7.64 (6.38-10.14) p = 0.033] and IL-8 [pg/ml; 25.85 (11.63-58.40) vs. 17.56 (6.44-39.08) p = 0.003] but lower CD8+ T lymphocyte count [cells/mm3; 334.02 (249.35-420.71) VS 380.95 (291.73-471.25) p = 0.038]. However, there was no significant difference in serum IL-6 concentration and CD4+ T lymphocyte count between the two groups. After 2 months of anti-tuberculosis treatment, 39 (24.4%) cases had suboptimal treatment response, including 23 (28.7%) TB-DM patients and 16 (20%) TB-NDM patients. There was no difference in suboptimal response rate (SRR) was found between the two groups (p = 0.269). The multivariate logistic regression analysis indicated that retreatment for TB [AOR: 5.68 (95%CI: 2.01-16.08), p = 0.001], sputum smear positivity [AOR: 8.01 (95%CI: 2.62-24.50), p = 0.001] were associated with SRR in all participants, and in TB-DM group, only sputum smear positivity [AOR: 16.47 (1.75-155.12), p = 0.014] was positive with SRR. DM is a risk factor for pulmonary cavity formation and sputum smear positivity in TB population. Additionally, TB-DM patients is characterized by enhanced cytokine responses and decreased CD8+ T lymphocytes. The retreatment for TB and sputum smear positivity were associated with the occurrence of suboptimal treatment response.