For the most part, the above answers are correct: sword-and-board is not an optimal choice in 3.x. You gain only a little defense, at the cost of a lot of offense.
The various historical perspectives (both of D&D and of warfare) are also very useful and interesting.
This answer is probably less so, but I wanted to comment on a few niche or weird uses of shields that can be viable (in this case, defined as “not obviously worse than easier options”).
Spellcasters
Spellcasters should basically always use a shield,1 even if it’s just a mithral buckler (which has 0 Armor Check Penalty and 0% Arcane Spell Failure, allowing even arcanists without proficiency to wear it without penalty). The AC bonus is basically free, since you weren’t going to be attacking with a weapon anyway.
The possibility of getting magic shield enhancements on that shield, however, is what really makes it crucial. Even if all the enhancements you want are available on armor, the quadratic growth of magic armor costs means that is very desirable to split effects between armor and shield. A +1 soulfire2 mithral buckler costs 26,015 gp, but adding soulfire to your +1 moderate-fortitude twilight3 mithral chain shirt costs 56,000 gp. That’s very-nearly 30,000 gp in savings. That’s not even getting into the fact that a +1 heavy-fortitude soulfire twilight mithral chain shirt is impossible before Epic levels, since it is a +11-equivalent.
This cost savings is so good that even those who do want to swing a big weapon should consider a heavily-magic’d buckler;4 the −1 to attack rolls can easily be offset by the powerful magics you can apply to yourself with one.
1 This statement is not true at low levels where even a mundane shield may represent a large portion of one’s wealth (particularly for arcanists who need to pay up for mithral), and is also not true for fighter/mage hybrids who want to be able to deal significant melee damage.
2 Soulfire from Book of Exalted Deeds makes you immune to death effects, negative energy, and negative levels. It costs a +4-equivalent, and is worth every gp.
3 Twilight from Magic Item Compendium and/or Player’s Handbook II reduces Arcane Spell Failure by 10%. +1-equivalent.
4 Or a heavy or tower shield with the animated property, though it will increase the cost of the shield (and additional properties) dramatically. Debatable whether or not that’s worth the +1 AC and +1 Attack, or whether the −10 ACP and cost of the +1 animated tower shield is worth +4 AC and the ability to use it for cover. Anyway, animated is +2-equivalent.
Crusader
The Crusader from Tome of Battle gains a few ways to do unique things with a shield, such as using it to block an adjacent ally. More importantly, most of the Crusader’s damage comes from the use of his martial maneuvers; careful selection of maneuvers can diminish the significance of the two-handed bonuses to damage.
Ye’ can hit ’em wit’ it
Shield bashes are not really terribly good attacks. However, few weapons have as many feats, special magic properties, and the like devoted to them. You can stack a whole bunch of these together to... be a really bizarre warrior that fights by hitting people with his shield.
Strictly speaking, you can even two-hand the shield. I totally imagine this as grabbing the shield by the rim and whacking people with it, which is hilarious. Even barring that, you could use Agile Shield Fighter (Player’s Handbook II if I remember correctly) to get a cheaper version of Two-Weapon Fighting (doesn’t require the Dex), and then go ahead and dual wield a pair of shields. This is possibly an even more hilarious image.
With Improved Shield Bash, this has the advantage of letting you have the AC (from one shield, they still don’t stack) and the attack. It’s not really anything like optimal – a greatsword or lance would be a far superior weapon – but in the right setting/campaign it could be awesome. Improved Shield Bash combines well with Dungeoncrasher (Dungeonscape), which allows you to do considerable damage when you Bull Rush someone into a wall. If you can pin someone in a corner, they’re in for a world of hurt this way.