If masks didn't stop the spread of disease, nobody, even doctors, would bother. The problem is that mask usage writ large does not have a cost/benefit point that warrants recommendation by CDC.
Study: "wearing a mask and washing your hands has been shown to stop infection."
Critic: "This study is worthless, it can show which of these procedures was effective!"
Study: "uh, err..."
Confounding factors would uncontrollable factors that people couldn't implement themselves. People can clearly wash their hands and wear masks.
Essentially the way to treat this is not a study of N doctors but a study of only n departments, which turns it more into an anecdote - albeit a compelling one.
Edit: in addition, the departments used to dealing with airborne infectious disease may have had specialized protocols and policies that the other departments did not have.
However, one part of your comment stood out to me: the infectious disease units also have higher HVAC standards than say regular areas (e.g., https://www.hfmmagazine.com/articles/3246-studying-airflow-i...).
Piling up multiple layers of a completely ineffective barrer does not make it effective.'
It'd be like trying to use layers of netting to hold back the sea.