More precisely how did it survive the inquisition for example? As I understand this should have been considered with craft or pagan.
The inquisitions were not charged with stamping out 'paganism', they were charged with rooting out heresy. Astrology in and of itself was not considered a 'demonic magic' and therefore did not meet the test of heresy. It did skirt the fine line of divination which Catholic theologians since antiquity generally held was the sole prerogative of God and trespassing that line was assumed to be invoking demonic powers; however unlike other forms of divination, astrology maintained distance from criticism by sometimes complex argumentation. By the high middle ages, with resurgence of astrology, no practicer of it (among the educated, as a form of astronomy) would have thought of themselves as a magician, but closer to a scientist as we would think it; kings, queens, priests, bishops, monks, abbots and popes practiced astrology.
Best on this are the chapters on astrology in Richard Kieckhefer's Magic in the Middle Ages, Cambridge University Press, 2000; there is full discussion of the opinions of antiquity and medieval theologians on astrology.
Finally, I think your title is trying to suggest that the Church repressed or combatted science? This is a fictional conflict created in the 19th century based on deliberate misreading and ignoring evidence, the Catholic Church has never opposed science nor repressed it. In fact, quite the opposite.
This submission was reported because the way the question is phrased betrays soapboxing. On the strength of the answer, however, and because I am unsure of malice, it has been approved. Please phrase your questions avoiding so-called 'emotional language' the next time you ask.
Cheers.