Objective: The aim of this study is to investigate how individuals with type 2 diabetes mellitus' pancreatic β-cell function index and insulin resistance index are affected by tuberculosis infection. Methods: The study group consisted of 89 patients with type 2 diabetes mellitus and tuberculosis infection who were admitted to Jingzhou Chest Hospital between March 2019 and March 2021. Gender and duration of diabetes were matching conditions. The control group was made up of 89 patients with type 2 diabetes who were admitted to Jingzhou Central Hospital's endocrinology department during the same period. The two patient groups provided general information such as gender, age, length of diabetes, and blood biochemical indexes such as glycosylated hemoglobin (HbA1c), fasting glucose (FPG), and fasting C-peptide (FC-P). The HOMA calculator was used to calculate the HOMA-β and the HOMA-IR, and intergroup comparisons and correlation analyses were carried out. Results: Regarding gender, age, disease duration, FC-P, and HbA1c, the differences between the two groups were not statistically significant (P > 0.05). However, BMI, FPG, HOMA-β, and HOMA-IR showed statistically significant differences (P < 0.05). In comparison to the control group, the study group's HOMA-β was lower and its HOMA-IR was greater. According to Spearman's correlation analysis, HOMA-β had a negative association (P < 0.05) with FPG, HbA1c, and the length of the disease, and a positive correlation with BMI and FC-P. A positive correlation was found between HOMA-IR and BMI, FPG, and FC-P (P < 0.01), as well as a correlation with the length of the disease (P > 0.05) and HbA1c. Conclusions: In type 2 diabetes mellitus combined with tuberculosis infection, the patients had higher FPG levels and lower FC-P levels, the secretory function of pancreatic β-cells was more severely impaired, and insulin resistance was more obvious.