For the same reason that words meaning ‘cheers’ (said when toasting) often mean ‘health’: when greeting someone, it is a very common courtesy to wish them good health. There are many more examples from the world’s languages of words for ‘hello’ (and ‘goodbye’) having meanings that are related to health or religious blessings. The word ‘salutation’ (and ‘salute’) itself comes from the Latin noun salus, meaning both ‘health’ and ‘greeting’.
Interestingly, though, the word that sparked this question, English ‘hello’, is not at all related to ‘health’. Etymonline writes:
hello
1883, alteration of hallo, itself an alteration of holla, hollo, a shout to attract attention, which seems to go back to at least c.1400. Perhaps from holla! "stop, cease." OED cites Old High German hala, hola, emphatic imperative of halon, holon "to fetch," "used especially in hailing a ferryman." Fowler lists halloo, hallo, halloa, halloo, hello, hillo, hilloa, holla, holler, hollo, holloa, hollow, hullo, and writes, "The multiplicity of forms is bewildering ...."
In other words, even though ‘hello’ and ‘health’ are related in many languages, there is no need for them to be, and in English they are not. The fact that the first syllable in both words is pronounced the same is pure coincidence (if you say ‘hullo’ instead of ‘hello’, this is even more obvious, since they then only have the /h/ and the /l/ in common).
However, the greeting-related verb/exclamation ‘hail’ (as in “Hail, Caesar!”) is related to the adjective ‘hale’ and the noun ‘health’; as well as to ‘whole’, the original meaning of ‘hale’ going from ‘whole’ to ‘undamaged/unscathed’ to ‘healthy’; and the now quite archaic noun ‘wassail’ that originally meant ‘be healthy’, then became something of a drinking formula, kind of like ‘cheers’, and finally ended up being a word for lively drinking festivities, or even the drink partaken in—quite the evolution!