The psychological research on what’s sometimes called "impact bias" helps explain this.[2] We’re systematically bad at predicting how we’ll feel about future events, we overestimate the impact of both good and bad things, and we’re also bad at accurately remembering how we felt about past events.
We tend to remember the emotional peak of an experience rather than its average, which means that periods of life that contained significant highs get remembered as better than they actually were, on average, to live through.
The good old days also weren’t uniformly good. The decade you’re nostalgic for also contained the argument that went on for three days, the job anxiety, the health scare, the money worry, the relationship that almost didn't make it. Memory edits those out, or softens them, or reframes them as the difficulties that made the good parts worth it.
What you’re nostalgic for isn’t the period as it actually was. It’s the period as your memory has reconstructed it, stripped of its mundanity and its difficulty and its uncertainty.
There’s also the question of what you were paying attention to at the time. The research on attention and wellbeing consistently shows that people who are focused on the future, planning, worrying, anticipating, report lower levels of present-moment satisfaction than people who are focused on what’s actually happening right now.[4] Which means that the good old days were, in part, invisible while they were happening because you were too busy thinking about what came next.