Sweet purpose of Sugar

I'll admit I thought this was easy. Why do we use sugar in our baking? Answer: to make it sweet. This seems a very good reason when making sweets. Although you're right, you're missing a few bits. I was missing quite a few bits myself, thinking it was only to make desserts and sweets.

When looking up the chemical properties of sugar you will find that sugar enhances flavour, colour and texture and works as a preservative. 

It's a dead giveaway, I know. But one of the main reasons we love sugar so much is because it is sweet. It's why we use it in our baked goodies. Different sugars give us different flavours: darker sugars or honey add a lot more flavour, while light sugars give a more soft, caramelized taste.

Colour - Bake it brown
Even in small amounts sugar enhances the colour of the crust of our bakes. Increasing the amount of sugar in a recipe will result in a darker baked good, while ommitting sugar altogether will result in a very pale loaf. Especially when using sugar as a glazing, breads and cakes will get a dark and very glossy finish. One might go so far to say that our lovely dark crusts are simply caramelized sugar. However, sugar burns easily as well, so you will notice pastry and cakes, as opposed to bread, will require a lower oven temperature.

Texture - Keeping it moist and fluffy
One of the main effects of sugar on the texture of baked goods is it's ability to attract moisture, which gives cakes and breads a tender texture. When you compare bread to cake the difference becomes obvious. Cake, with a high amount of sugar, is more moist and soft than the practically sugar-less bread. This absorbing property doesn't only affect baked goods, but also plays a vital role in the texture and form of candy and jams.
       Another effect of sugar on the texture of baked goods is it's ability to control the gluten formed in dough and thus the 'fluffiness' of the end result. The proteins glutenin and gliadin both bind to sugar, which prevents them from binding to each other to form gluten. Especially in bread sugar plays a big role in activating the rising agents. Modern yeasts no longer need sugar to work, but will still rise a lot faster when fed with sugar. Especially enriched 'heavier' breads will need this extra boost to create a good bread.

Sugar is a very unsuitable home for fermentation, rot and other bacteria. Thus, adding sugar will result in goods that stale less quickly. This preserving quality of sugar is easiest to imagine when you think of jams and candy. Just by adding sugar to fruits you can keep jam and candy for years (if stored properly!).

Raw Demerara sugar, granulated sugar and dark, caster sugar
Can I go wrong with too much sugar?
Certainly: when adding too much sugar a baked goods will become very dark and burn easily. The sugar will also decrease the amount of gluten formed, resulting in a very wet and compact texture. In bread sugar can also feed the yeast too much, resulting in a bread that will rise too much and collapse until barely anything is left. When making jams too much sugar can result in a very thick jam or even turn rock hard.

Can I go wrong with too little sugar?
Too little sugar is also a problem. When omitted altogether, bread dough will not rise or might take double the time to rise sufficiently. Baked goods will become pale and stale more quickly. On top of that they will become very tough and dry. You'll be getting rid of your sweetener and texture-enhancer, which you normally don't want.

Palm sugar, sugar cane and fine and coarse rock sugar
Now we have enough reasons to add even more sugar to our baked goods! Keep in mind there are millions of different products that count as 'sugar', each with their own aroma and texture. Think of liquid sugars, syrups and honey. Each type of sugar has a slightly different effect on baked goods. Dark sugars give a lot more taste to a cake than a granulated sugar, but it will also add more colour and acidity due to the higher molasses content. This means they cannot easily be used interchangeably. For instance, honey has a much stronger sweet taste and will be used in much smaller quantities than granulated sugar. A post on the different kinds of sugar and their uses, as well as how to substitute them, is something to look forward to in "Oven Info".

My References:
Bread by Christine Ingram and Jennie Shapter 
Ik Kan Koken by P.J.S. van Rijn (1949)
What is white sugar? by About.com
Kitchen Chemistry by Culinate