The COVID-19 pandemic, caused by the SARS-CoV-2 virus, suddenly erupted at the beginning of 2020 in China and soon spread worldwide. This has caused an outstanding increase on research about the virus itself and, more in general, epidemics in many scientific fields. In this work we focus on the dynamics of the epidemic spreading and how it can be affected by the individual variability in compliance with social norms, i.e., in the adoption of preventive social norms by population's members, which influences the infectivity rate throughout the population and through time. By means of theoretical considerations, we show how such heterogeneities of the infection rate make the population more resistant against the epidemic spreading. Finally, we depict possible empirical tests aimed to confirm our results.