Although previous studies have demonstrated increased depression related to COVID-19, the reasons for this are not well-understood. We investigated the association of compliance with COVID-19 public health measures with depression. Data from the 2020 Korea Community Health Survey were analyzed. The main independent variable was compliance with rules based on three performance variables (social distancing, wearing a mask in indoor facilities, and outdoors). Depression was assessed using Patient Health Questionnaire-9 scores. Of 195,243 participants, 5,101 participants had depression. Bad and moderate performance scores for compliance were associated with depression (Bad score, men: adjusted odds ratio [aOR] = 2.24, 95% confidence interval [CI] = 1.29–3.87; women: aOR = 2.42, 95% CI = 1.42–4.13; moderate score, men: aOR = 1.31, 95% CI = 1.02–1.68; women: aOR = 1.28, 95% CI = 1.07–1.53). In the subgroup analysis, among the quarantine rules, not wearing a mask indoors was the most prominently associated with depression. In participants with a high level of education, non-compliance with quarantine rules was significantly associated with depression. People who do not comply with public health measures are more likely to be depressed. The preparation and observance of scientific quarantine rules can help mental health in the ongoing COVID-19 pandemic and another infectious disease pandemic that may come.