Why is 1-methyl-2-pyrrolidone (N-methyl-2-pyrrolidone; NMP) developing a yellow color after distillation?
NMP is a biodegradable liquid with high power for solubilizing chemicals, and thus can be used as a safe aprotic solvent in many reactions. Yet, it is very hygroscopic and is slowly oxidized by air (Ref.1). Even though it is thermally stable, steel parts of apparatuses used in the presence of NMP as the solvent have been reported to undergo a corrosive reaction at temperatures above $\pu{300 ^\circ C}$, which restricts its applications at higher temperatures in a metal-containing setups (Ref.1). Also, NMP has been shown to oxidize in the presence of transition metals under nontropospheric conditions by well-known catalytic mechanisms (e.g., Ref.2), as well as in the presence of UV-light and hydroxyl radical initiators. Thus, it is possible that NMP tends to oxidize in the presence of air giving the yellow color by the oxidized product(s).
What to do to reduce/remove the color?
The answer is within the question: "when I redistilled it under vacuum, it came out colorless but turned yellow the next day." I believe this color change is due to its exposure to air. According to the literature, it is better off if you use NMP freshly distilled. If it is difficult to do so, keep freshly distilled solvent in nitrogen atmosphere for the longer use (Ref.3). The following image shows the NMP resistance to oxidize even in the presence of better metal catalyst under $\ce{N2}$ (Ref.3):

Keep in mind that the work in Ref.3 has demonstrated that oxidation of NMP was shown to correlate with decreasing pH, and this image demonstrate that this oxidation can be quenched by using an inert nitrogen atmosphere.
References:
- Abolghasem Jouyban, Mohammad A. A. Fakhree, and Ali Shayanfar, "Review of Pharmaceutical Applications of N-Methyl-2-Pyrrolidone," Journal of Pharmacy & Pharmaceutical Sciences 2010, 13(4), 524-535 (DOI: https://doi.org/10.18433/J3P306).
- Russell S. Drago, "Homogeneous metal-catalyzed oxidations by $\ce{O2}$," Coordination Chemistry Reviews 1992, 117, 185-213 (DOI: https://doi.org/10.1016/0010-8545(92)80024-L).
- Gavin Lennon, Shannon Willox, Ragini Ramdas, Scott J. Funston, Matthew Klun, Robert Pieh, Stewart Fairlie, Sara Dobbin, and Diego F. Cobice, "Assessing the Oxidative Degradation of N-Methylpyrrolidone (NMP) in Microelectronic Fabrication Processes by Using a Multiplatform Analytical Approach," Journal of Analytical Methods in Chemistry 2020, Article ID 8265054, 12 pages (DOI: https://doi.org/10.1155/2020/8265054).