The purpose of this study was to describe and compare the clinical data, laboratory examination and imaging examination of tuberculous spondylitis (TS) and pyogenic spondylitis (PS), and to provide ideas for diagnosis and treatment intervention. The patients with TS or PS diagnosed by pathology who first occurred in our hospital from September 2018 to November 2021 were studied retrospectively. The clinical data, laboratory results and imaging findings of the two groups were analyzed and compared. The diagnostic model was constructed by binary logistic regression. In addition, an external validation group was used to verify the effectiveness of the diagnostic model. A total of 112 patients were included, including 65 cases of TS with an average age of 49 ± 15 years, 47 cases of PS with an average of 56 ± 10 years. The PS group had a significantly older age than the TS group (P = 0.005). In laboratory examination, there were significant differences in WBC, neutrophil (N), lymphocyte (L), ESR, CRP, fibrinogen (FIB), serum albumin (A) and sodium (Na). The difference was also statistically significant in the comparison of imaging examinations at epidural abscesses, paravertebral abscesses, spinal cord compression, involvement of cervical, lumbar and thoracic vertebrae. This study constructed a diagnostic model, which was Y (value of TS > 0.5, value of PS < 0.5) = 1.251 * X1 (thoracic vertebrae involved = 1, thoracic vertebrae uninvolved = 0) + 2.021 * X2 (paravertebral abscesses = 1, no paravertebral abscess = 0) + 2.432 * X3 (spinal cord compression = 1, no spinal cord compression = 0) + 0.18 * X4 (value of serum A)−4.209 * X5 (cervical vertebrae involved = 1, cervical vertebrae uninvolved = 0)−0.02 * X6 (value of ESR)−0.806 * X7 (value of FIB)−3.36. Furthermore, the diagnostic model was validated using an external validation group, indicating a certain value in diagnosing TS and PS. This study puts forward a diagnostic model for the diagnosis of TS and PS in spinal infection for the first time, which has potential guiding value in the diagnosis of them and provides a certain reference for clinical work.