Keep in mind vitamin D is really, among other things, an immune signaling molecule.
So, we know the mechanism, and it's quite plausible that supplementation works.
In other words, as an skeptic, I don't think it's just an epidemiological correlation.