Patients with underlying diseases do not respond adequately to vaccines. Thus, continued research on the effects of vaccination in patients with comorbidities is crucial to evaluate the necessity of vaccination in this population. This study assessed the protective effects of inactivated vaccines on the severity and prognosis of COVID-19 in patients with comorbidities. A real-world retrospective cohort study was conducted from April 7, 2022, to June 6, 2022, at the Fudan University Pudong Medical Center. The collected data included demographic characteristics, symptoms, clinical severity, and outcomes of the COVID-19 patients. A total of 3,996 indigenous confirmed cases and asymptomatic infections with the Omicron variant were enrolled. Of these, 1322 (33.1%) patients had chronic comorbidities. Compared to others, COVID-19 patients with comorbidities were older, had lower vaccination rates, longer days of nucleic acid conversion and hospitalization, and a higher incidence of severe-critical illness and composite endpoint. Multivariable analyses suggested that in the comorbidity group, two-dose- (odds ratio [OR] 0.38, 95% CI 0.24-0.60; OR 0.20, 95% CI 0.08-0.51) and three-dose vaccinated patients (OR 0.26, 95% CI 0.14-0.47; OR 0.21, 95% CI 0.08-0.58) had a lower risk of aggravation and the composite endpoint; similar results were observed in the non-comorbidity group. Two or more doses of inactivated vaccines could prevent deterioration and poor prognosis in Omicron-infected patients, regardless of the presence of an underlying disease. Our findings support maximizing coverage with inactivated vaccines in highly vaccinated populations, such as those in China.