ObjectivesTo investigate and compare the associated factors of depression, anxiety, and other psychological differences between patients with Corona Virus Disease 2019 quarantined in square cabin hospitals (SCH) and isolation wards (IW) in China.MethodsCluster sampling method was performed during Shanghai’s Two-Month Lockdown in 2022. Hospital Anxiety and Depression Scale Depression subscale (HADS-D), 7-tiem Generalized Anxiety Disorder Scale (GAD-7), Pittsburgh sleep quality index (PSQI), and Perceived Social Support Scale (PSSS) were used to investigate psychological differences.ResultsThe HADS-D and GAD-7 scores of SCH patients were significantly higher than those in IW (p < 0.001; p = 0.0295). Sleep latency (SCH-IW = -3.76, p < 0.001), sleep duration (SCH-IW = -2.22, p < 0.05), habitual sleep efficiency (SCH-IW = -4.11, p < 0.001), sleep disturbance (SCH-IW = -3.59, p < 0.001) and use of sleep medication (SCH-IW = -5.18, p < 0.001) of SCH patients were significantly worse. Depression was the main emotional problem of quarantined patients. Patients in SCH had lower social support. Sleep disorders and the lowest oxygen saturation ≤ 93% were risk factors for depression, while social support and child status were protective factors. Myalgia and constipation were risk factors for anxiety, while marital status was the protective factor.ConclusionPatients quarantined in SCH had higher risks of depression and anxiety, lower sleep quality and social support. Somatic discomfort and sleep disorders exacerbated depression and anxiety, which could be ameliorated by social support and taken into consideration in future SCH construction.