The demise of Western alchemy was brought about by the rise of modern science with its emphasis on rigorous quantitative experimentation and its disdain for "ancient wisdom". Although the seeds of these events were planted as early as the 17th century, alchemy still flourished for some two hundred years, and in fact may have reached its apogee in the 18th century.
Robert Boyle (1627–1691), better known for his studies of gases (cf. Boyle's law) pioneered the scientific method in chemical investigations. He assumed nothing in his experiments and compiled every piece of relevant data; in a typical experiment, Boyle would note the place in which the experiment was carried out, the wind characteristics, the position of the Sun and Moon, and the barometer reading, all just in case they proved to be relevant. (Pilkington p.11) This approach eventually led to the founding of modern chemistry in the 18th and 19th centuries, based on revolutionary discoveries of Lavoisier and John Dalton — which finally provided a logical, quantitative and reliable framework for understanding matter transmutations, and revealed the futility of longstanding alchemical goals such as the philosopher's stone.
Meanwhile, Paracelsian alchemy led to the development of modern medicine. Experimentalists gradually uncovered the workings of the human body, such as blood circulation (Harvey, 1616), and eventually traced many diseases to infections with germs (Koch and Pasteur, 19th century) or lack of natural nutrients and vitamins (Lind, Eijkman, Funk, et al.). Supported by parallel developments in organic chemistry, the new science easily displaced alchemy from its medical roles, interpretive and prescriptive, while deflating its hopes of miraculous elixirs and exposing the ineffectiveness or even toxicity of its remedies.
Thus, as science steadily continued to uncover and rationalize the clockwork of the universe, founded on its own materialistic metaphysics, Alchemy was left deprived of its chemical and medical connections — but still incurably burdened by them. Reduced to an arcane philosophical system, poorly connected to the material world, it suffered the common fate of other esoteric disciplines such as astrology and Kabbalah: excluded from university curricula, shunned by its former patrons, ostracized by scientists, and commonly viewed as the epitome of charlatanism and superstition.
These developments could be interpreted as part of a broader reaction in European intellectualism against the Romantic movement of the preceding century. Be as it may, it is sobering to observe how a discipline that held so much intellectual and material prestige, for more than two thousand years, could disappear so easily from the universe of Western thought.