What does gluten "do" in baking?
I went into some detail with this in my answer to What are the factors that affect the chewiness, softness, moisture of bread based desserts like cinnamon rolls?

To summarize my points there and add some more (simplified) detail on the chemistry:


Gluten is responsible for elasticity of dough, which is perceived as chewiness.  The difference between bread, quickbread (muffins/scones), and cake is largely due to the difference in gluten formation, with cake having the lowest amount and bread having the highest.
It does not directly cause rising - the leavening agent (yeast, baking powder, etc.) is responsible for that. What it does do is form a protein network by cross-linking, which not only results in the elasticity above but also traps gas and prevents it from escaping during the baking process. The "rising" in baked goods is essentially just stretching of the gluten network. This is why hydrocolloids such as xanthan and guar gum can mimic some of the effects in gluten-free recipes; although the mechanism is completely different - in essence, they're creating a very thin gel.
Gluten is also exceptionally good at both absorbing and retaining moisture; it can absorb up to 150% (1.5 times its own weight) in water. One thing you'll notice about typical wheat products vs. their gluten-free equivalents is that latter don't last too long and have to be frozen or consumed quickly. Part of this is due to preservatives in commercial baked goods, but much of it is also simply due to the gluten retarding moisture loss.  You can think of it as a kind of natural preservative.
It's activated by water and heat and is (relatively) slow-acting, which gives it a high tolerance with respect to time and temperature. This is why many people will tell you that bread is "forgiving" while cake and other low-gluten/gluten-free products are not. When baking without gluten, you will have to be very precise about all of your measurements.
Its coagulation action is actually very similar to that of egg whites, and pure gluten (AKA vital wheat gluten) is sometimes actually used as a replacement for egg whites. A meringue is just heavily aerated egg whites and specifically protein; gluten is basically doing the same thing inside of whatever you're baking.
Finally, it provides nutritive protein when eaten. Wheat gluten is about 75% protein and all-purpose flour is about 10% gluten. That means 7.5% of the flour you consume is actually protein. Of course that's nowhere near what you get from meat, but it's still a significant contribution to one's diet.


In short: Gluten does a lot of things. Keep in mind when doing gluten-free baking that a lot of the substitutes only replicate one or two of the effects.