These disciplines were once aligned. It would be great to understand the factors/catalysts that triggered the divergence, and what caused astrology to fall to the depths of pseudoscience and horoscopes. Was it publicly debunked? Did it fall out of favour in academia due to any lack of evidence? What caused it to become so stigmatized?
There was no single moment when astrology and astronomy decisively divided. They were, for a very long time, the same discipline, with the same practices, and many of the same concerns. What we would today call "astrology" was the reason why people in many civilizations performed the activities that we would today call "astronomy": systematic observation of the heavens, sometimes using various kinds of instruments that extended human senses, in order to learn their mysteries, which for them included their intervention on Earth.
In Western Europe, astronomy became more and more associated with mathematical analyses in the early modern period. This was not, by itself, in opposition to astrological concerns. Tycho Brahe, Johannes Kepler, and Galileo, for example, were practicing astrologers as well as astronomers. But there is a sense that the work of observing the heavens began to shift in this period. Kepler's work, for example, was heavily motivated by various kinds of spiritual, religious, and mystical ideas (and indeed, he saw his main task as "reforming" astronomy with better mathematical models), but the actual work that ended up being generated and which caught the interests of others were mathematical "laws of nature" that described the orbits of planets, and did so in a way that completely up-ended prior assumptions about how those worked (for example, he ended up banishing the idea that they revolved in perfect spheres, which had been the Western assumption since Plato at least). Galileo's work with the telescope further moved things in another, different direction: one about regarding the planetary bodies not as abstracted shapes or lights, but as objects with mass and heft and imperfections. Galileo's moon is not a spiritual moon; it is a chunk of rock covered in craters. Galileo's Sun is not a perfect Sun; it is a fireball with tiny spots on it. So while Kepler and Galileo practiced astrology, you can see how their works contained the seeds of a very different view of the heavens. Newton was quite interested in alchemy and astrology, but his own work utterly divorced the view of the heavens from the Aristotlean approaches and refocused them on very different problems and questions and tools (like the calculus).
One of the things one sees in the history of science, especially the transitions that took place during the period we often label "The Scientific Revolution" (but other places as well), is that changes of worldview are rarely dramatic and based on some singular experiment or observation or person. They often end up being somewhat gradual, as a community of researchers shifts their interests and concerns and questions to other areas, and as new tools or ideas end up fueling work in these new ideas, at the expense of older ones, which start to just look irrelevant. (This is a somewhat less dramatic version of Kuhn's idea of the paradigm shift.) As with the split between alchemy and chemistry, the split between astrology and astronomy seems to have been this sort of thing. If you are an active participant in astronomical debates in the 18th century, astrology just looks uninteresting to you — it's not where the action is at, and it's not clear how you would apply the really cool emerging ideas and instruments (like the telescope) to answer the kinds of questions that astrology cares about. It should also be noted that the dominant academic models in the medieval and early modern periods were still tied in many ways to Christian religious institutions (either Catholic or Protestant) and these places were usually quite officially hostile to astrology (which was interpreted as an attempt to practice a sort of magic, or just a false knowledge), so astrology (like alchemy) was often done quietly or secretly (unlike, say, the practices of astronomy, which were part of the medieval and early modern curriculum, but interpreted as both mathematical exercises and an attempt to understand the mind of God, which is not the same thing as predicting the future).
The period we call The Enlightenment (18th century or so) is a tricky one, but one of the things that is associated with it were people trying to very explicitly draw lines between what they considered to be "science" and "non-science." So while the splits between astronomy/astrology and alchemy/chemistry may have been slow and gradual, by the Enlightenment they had more or less already taken place, and the scientists and philosophers at that point proudly proclaimed that their new sciences ought to eclipse the old — sort of after the fact. So in the Enlightenment you have people saying, "we have given up on alchemy and astronomy, they are not science," but they should be read not as having caused that to happen, but more like they are reporting that it has happened and that they saw this as part of what made them so much more "enlightened" than an imagined medieval past. (That many of their early modern heroes, like Kepler and Newton, were more "magically" inclined than they were, was something they tended to deliberately obscure, because they liked to believe there was more of a contrast between the pre-"Enlightened" world and the "Enlightened" one.) The one place where astrology still "held on" in this period was medicine, where it persisted along with much other Galenic influences into the 18th century.
The efforts to debunk astrology seem to be much later, and not a response to any learned belief in it, but as part of an attempt to reform fears of lay interest in pseudoscience. This is the kind of thing that one would primarily expect to see in the 19th century, when there emerged considerable interest in trying to capture lay audiences' attention and impress upon them the importance of regarding "science" as having the ultimate authority in the natural world.
Anyway. There is a lot one could say, and one is talking about beliefs that changed over the course of centuries, so there are no doubt outliers and regional differences (and I've only talked about Western Europe; I am sure the situation was different in China). I think the main point here is to not imagine that science "disproved" astrology in some sort of epic showdown, or that people went to bed one day as astrologers and rose the next day as astronomers. It was a gradual shifting and realigning of interests, one that you should imagine not just about ideas but about changing communities of people, and at some point astrology was so marginalized from the practice of mainstream scientific work that it became a convenient example of the kind of nonsense that pre-scientific people believed in (and un-Enlightened laypeople still believe in), and so served a very different sort of rhetorical role than it had.
The essay by H. Rutkn on Astrology in the Cambridge History Science is a very nice overview of the complexities of this question.