All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
We have no idea how those people came to learn about the condition of the infected persons, the details of their infection, and personal lives.
As for considering astrology as a form of magic, besides being a form of lying, it is because astrology is one of the acts of soothsayers, which are mostly lies. Soothsayers are magicians because they bewitch people with their words. In a Hadith reported on the authority of Ibn Abbas, the Prophet said, “If anyone acquires a section of the science of the stars for a purpose other than what Allah has mentioned, he has acquired a branch of magic. The astrologer is a soothsayer, the soothsayer is a magician, and the magician is an infidel.” Narrated by Ruzain in his Musnad.
In Sharh al-Mishkat, Mullah 'Ali al-Qaari said, “It was narrated that Ibn Abbas said: The Messenger of Allah said: (He who acquires a section of the science of the stars) i.e. learns a kind of stars sciences (for a purpose other than what Allah has mentioned), this phrase refers to the third type mentioned in the Hadith narrated by Qataadah (has acquired a branch of magic) that is: has learned an amount of magic knowledge, and this is a form of blameworthy knowledge, as it is either a form of Fusouq (deviation from the path of Allah) or Kufr (disbelief). (The astrologer is a soothsayer, the soothsayer is a magician,) because he enchants people with his words (and the magician is a disbeliever). Thus, soothsayers and astrologers are disbelievers.”
Ibn Taymiyyah said: The astrology, such as discerning information about terrestrial events through astrology is magic and is forbidden by consensus of scholars. [End of Quote].
Allah knows best.