When ill first showed up in the early thirteenth century, it had nothing to do with health. Back then, it was just evil, hurtful, difficult, or unfortunate. The “unwell” sense of the word didn’t show up until the mid-fifteenth century, over two hundred years later, possibly changing meanings due to the influence of an Old Norse idiom. Old Norse is actually where we get the word from; it’s illr in that language, and that’s as far back as the word can be traced. And I don’t know if this needs to be said, but ill has nothing to do with words like illegal or illicit. The il- prefix there actually comes from the word in-. They just dropped the n.
Coincidence is never more prevalent than in looking up the histories of words.