Glycolysis is a conserved central pathway in energy metabolism that converts glucose to pyruvate with net production of two ATP molecules. Because ATP is produced only in the lower part of glycolysis (LG), preceded by an initial investment of ATP in the upper glycolysis (UG), achieving robust start-up of the pathway upon activation presents a challenge: a sudden increase in glucose concentration can throw a cell into a self-sustaining imbalanced state in which UG outpaces LG, glycolytic intermediates accumulate and the cell is unable to maintain high ATP concentration needed to support cellular functions. Such metabolic imbalance can result in "substrate-accelerated death", a phenomenon observed in prokaryotes and eukaryotes when cells are exposed to an excess of substrate that previously limited growth. Here, we address why evolution has apparently not eliminated such a costly vulnerability and propose that it is a manifestation of an evolutionary trade-off, whereby the glycolysis pathway is adapted to quickly secure scarce or fluctuating resource at the expense of vulnerability in an environment with ample resource. To corroborate this idea, we perform individual-based eco-evolutionary simulations of a simplified yeast glycolysis pathway consisting of UG, LG, phosphate transport between a vacuole and a cytosol, and a general ATP demand reaction. The pathway is evolved in constant or fluctuating resource environments by allowing mutations that affect the (maximum) reaction rate constants, reflecting changing expression levels of different glycolytic enzymes. We demonstrate that under limited constant resource, populations evolve to a genotype that exhibits balanced dynamics in the environment it evolved in, but strongly imbalanced dynamics under ample resource conditions. Furthermore, when resource availability is fluctuating, imbalanced dynamics confers a fitness advantage over balanced dynamics: when glucose is abundant, imbalanced pathways can quickly accumulate the glycolytic intermediate FBP as intracellular storage that is used during periods of starvation to maintain high ATP concentration needed for growth. Our model further predicts that in fluctuating environments, competition for glucose can result in stable coexistence of balanced and imbalanced cells, as well as repeated cycles of population crashes and recoveries that depend on such polymorphism. Overall, we demonstrate the importance of ecological and evolutionary arguments for understanding seemingly maladaptive aspects of cellular metabolism.