Both of these studies are observational and retrospective, meaning they can only show a correlation between GLP-1 use and reduced (or at least less severe) infections, not prove a direct cause-and-effect relationship. At the same time, these are the only latest pieces of evidence pointing to a genuine germ-busting benefit from GLP-1 drugs.
I wonder if the likelihood that people taking a GLP-1 are probably better off financially, have a health care provider willing to spend on the drugs (and therefore probably a better medical system) or a combination of these and other traits are the real reason there are fewer infections.