The COVID-19 pandemic has profoundly impacted human society and offers a critical backdrop for investigating the Behavioral Immune System (BIS), which traditionally has focused on individual protection mechanisms driven by disgust. This individualistic focus neglects the role of collective behavioral and emotional responses in mitigating disease spread. To address this, we introduce a two-layer framework of the BIS, consisting of an individual layer driven by disgust, primarily manifesting in avoidance behaviors and biased attitudes, and a collective layer fueled by collective anxiety, characterized by isolation from outgroups and self-protection within ingroups. Our model shows that inadequacies in the individual-level BIS stimulate the emergence of a collective-level BIS, which in turn has a buffering effect on individual behaviors. We further explore the impact of social relation attributes on the collective-level BIS, categorizing them into fixed and flowing types based on selectivity and expected endpoints, finding that flowing relations prompt collective BIS responses through cooperation, while fixed relations do so through intimate relationships. This enriched framework offers important implications for public health policies and opens avenues for cross-cultural and cross-societal research by acknowledging the reciprocal influences between individual and collective behaviors in response to pathogen threats.