The idea of not allowing anonymity for protesters has its origins in combating racial violence and the KKK. Klan members suddenly lost a lot of their motivation to assemble in public, once they had to show their faces, those that did were less likely to commit illegal acts and the ones that did break the law were more likely to face legal reprocutions.
The contemplated ban on masks for protesters in Los Angeles was considered following increased violence by masked protesters and was not motivated by covid denial.