Both of these terms have been applied to World War II in retrospect because of the perceived differences between that war and that generation on the one hand, and future wars and generations on the other.
WWII is seen as the “good war” because it was a war with a clear purpose, one with which essentially all Americans agreed, and one that the US won. This is in contrast to wars like the Vietnam War, which many Americans did not like and which the US lost. It is also in contrast to the US invasion of Afghanistan, which Americans agreed with, but which had no clearly achievable military objective. In WWII, there was no worrying about whether the war was just or whether we would be able to tell when we had won. That made it a “good” war.
The generation that fought it is called the “greatest generation” because we perceive them as more dedicated, selfless, and patriotic than we are today. That generation went through a long war with many being killed and wounded. People had to make sacrifices at home in ways that we no longer need to when we go to war today. After the war, they were the ones who helped make the post-war economic boom.
For these reasons, we refer to WWII and the generation that fought it in these terms.