I'm first just going to just copy from this essay by R. Gil Student (hope that's allowed):
Ramban (Lev. 11:13) states that non-kosher animals are
physically unhealthy. Rashbam (Lev. 11:3) agrees and Rambam (Moreh
Nevukhim 3:48) offers this as a secondary reason for these [dietary] commands.
However, Abarbanel (Lev. 11:13, p. 65) and Akeidas Yitzchak (ch. 60)
argue against this approach. First, if this were true, the Torah would
be merely a book of medicine. Second, we see that gentiles eat
non-kosher animals and do not suffer health-wise. And third, why
aren’t poisonous animals mentioned explicitly in the text?
I [R. Gil Student] don’t
find these objections particularly convincing. The Torah requires
building a ma’akeh (guardrail) around your roof even though that is
merely safety related. No one argues that this somehow diminishes the
Torah’s value. And the argument is not that non-kosher animals are
poisonous, just that they are less healthy. Perhaps they contribute
slightly to an earlier death but social differences mask that
contribution. Only a controlled study, something with which the
Medievals were unaware, could truly answer this. And perhaps the Torah
already prohibited eating poisonous food in its general admonition to
take care of your health. Refraining from poison is obvious.
Refraining from these animals, which we still do not know whether they
are truly unhealthy, requires a new prohibition. Not that I find the
approach particularly convincing but I believe these two arguments can
I have two things to add to this: one, is that R. Yosef Bechor Shor also adopts this approach in his comments to Shemos 15:26.
Second, is that I've heard in the name of R. Moshe Shapiro (and I believe that this idea is printed somewhere in the writings of R. Akiva Tatz) that if one adopts this approach, the proper perspective is not to say that the Torah prohibits these animals because they are unhealthy. Rather, the truth of the matter is that the Torah (or some form of it) preceded the creation of the world, and therefore only because the Torah prohibited these animals, their nature is that they are unhealthy. One can, of course, argue which caused which (as one might do regarding morality) but I've always found this to be a fascinating idea.
Regarding the raltionship between kosher and health, besides for the obligation to eat kosher, Jews also have an obligation to take care of themselves, which means eating healthily. Some sources that state this explicitly include the Rambam (Rambam, Hilchot De'ot 4:1), Tur (O.C. 155), and Kitzur Shulchan Aruch (siman 32)