We don't know the exact side-effects of the use of the 8th Gate other than it resulting in "certain" death. Hence the theory that it reduces the target to ash is just that, a theory. We do know however that it will "kill the soul" by snuffing out the flame of their heart. So the first step would be to stop this from happening, which Naruto was able to do by (likely) sharing his life force through the Yang Seal, or the Yang component of the "Creation of all Things" to "Breath life into" Gai's dying heart.
With that side effect corrected, we are left with a living Gai that may or may not turn to ash. For example, if its only his leg that's turning to ash because the impact caused by Night Gai then breathing life into him would save his life, but not his leg. Now if the Eight Gate really is suppose to turn the user to ash then how did Naruto stop that affect? If that theory is to hold water and add up with the time-limit of the Gate and Lee's comments on how using the Gates will cause you to feel like your entire body is on fire then there is only one explanation to it.
The use of the 8th Gate causes the body to heat up until they turn to ash completely. When Gai used his final technique he concentrated all of his chakra and therefore all of the heat at this leg, causing that to be instantly turned to ash. When he fell over, out of juice his body was still heating up. Before it reached the point where it turned to ash, Naruto arrived and rapidly cooled down his body through the Yang Seal, evening out the balance of cold and warm. This also explains why Gai didn't instantly turn back to normal, but remain "dark skinned" with veins all over him, because the reverse progress takes time as all Naruto did was initiate it.
As to why he didn't save the leg, he likely couldn't do it by the time the war was ended as he no longer had the Yang Seal and as seen with Kakashi and Obito, it isn't done instantly and requires time, likely the larger the part, the more time is required.