I don't think it really has a reason. It's just natural in frogs and other animals, frogs however eat the shed and there is a theory about that. The theory is that they do it to cover tracks, incase of predators.
My crested gecko also does this, not as frequent as a frog however.
Edit: Mentat are you sure about that? My crested gecko and albino cranwelli both still shed and it's not like adults still grow.
Edit 2: I honestly believe they do it because the skin has gotten old, like us humans do it very slowly piece by piece, these guys just do it at once.
I honestly know nothing about it and can't seem to find why the shedding happends, but looking at it, I just think they do it more effectively then us. Amphibian skin might die off faster then ours, seeing as how it's absorbant, so they might need to dump the old skin for health reasons. I think it has something to do with growth in young animals offcourse, but I don't think that theorie would hold up for adults.