in cases of significant dehydration. there are other rehydration solutions that are closer to ideal, and possibly less likely to cause GI upset.
As mentioned, the sugar promotes active transport of sodium across the intestinal epithelium, which is critical in severe dehydration.
In every other scenario, Gatorade is a poor choice. And even in dehydration there are better choices. But given its availability and (for some) palatability, it is a reasonably good rehydration solution, and for this specific setting, better than water.