I've seen this mentioned many times on these boards. If there's already a thread on this, feel free to point it out and tell me to shut up.
The argument I've seen is that spellcasting is an extraordinary ability, so Shapechange should grant it. But I see three major problems with this argument:
1) Shapechange doesn't grant SLA, so it's obvious that the designers didn't indend it to grant spellcasting.
2) Spellcasting (ex) means you have the ability to cast spells in the abstract, but when exactly did you learn the verbal and somatic components? How are you casting spells when you don't have a single spell in your Spells Known list? If the creature you're turning into has the same class as you (sorcerer turning into a dragon, for example), you don't get two spell lists from the same class. Basically, I'd see this as a sorcerer who hasn't assigned Spells Known yet, or a wizard without a spellbook. For cleric casting, your god isn't going to give you spells just because you cast Shapechange; you have to earn them by being a cleric for a while.
3) I understand that it's a nice thought excercise for optimizers, but has any DM in the history of D&D actually allowed this?
Iv been letting players and npc's do this since 3.5 came out, and in all that time, iv never had any issues or problems with it.
I do have a few things that i require.
No matter what form you take, you need to be in that form while resting, and you need to do the normal things required for that caster to regain spells.. Pray, consult spellbook etc.
For casting requiring a spellbook, you need a spellbook with spells in it, and you need to master it.
For Spontaneous casting you gain the spells known of the monster you turn into.
For divine casting you need to pray to your deity to get spells etc.
If you change form for any reason, even if you turn into another monster with the same kind of spellcasting, you loose all memorized or ready spell slots, until you regain them again by having 8 hours of complete rest in the form followed by the normal procedure for gaining spells.