X-er here. Back in my day it was common for kids to walk to school. Maybe it still is, but I haven't noticed it in my area.
But that's not the origin of the saying (as far as I know) -
However I do remember me complaining to my parents about having to walk to school and being told "We had to walk to school too, uphill, even when it was snowing" - I think this was a common conversation during a certain period of time, and generationally we all decided our parents were exaggerating a bit and it became this long running joke/meme.
Also entirely possible the joke predates me, but it's one of those things that I always thought started with our generation.