Can a sandman bard use the bardic performance stealspell to steal a spell from an allied druid if the druid has already cast the spell?
I would say that a prepared spell means one that has been prepared but not yet cast. To be honest, I don't see a clear statement about this in the section on Divine spells, but for Wizard spells there is this statement:
Once a wizard prepares a spell, it remains in his mind as a nearly cast spell until he uses the prescribed components to complete and trigger it or until he abandons it.
And for Divine spells we do have:
Divine spellcasters prepare their spells in largely the same manner as wizards do, but with a few differences.
Since there isn't any clear statement that divine spellcasters retain prepared spells after they are cast, we should assume this is not one of the differences from wizard spells, so the same logic applies.
Thus, if the spell has been cast, it is no longer prepared, and cannot be stolen. (This is assuming it was prepared only once, or that all prepared instances of the spell have been cast.)
On top of that, you specifically state "from an allied druid". The Stealspell ability says:
A sandman can use performance to steal spells from his foes
So, rules as written, you can't use it on an ally. (Or alternatively, if you use it on an ally, they may become a foe. I.E. this is not something friends do to friends.)
No, they cannot
While unclear about how exactly "preparation" works, and what "the spell remains in his mind" actually mean, there are hints here and there in the Magic rules that spells are only considered prepared while they are still available to be cast. But the issue of is my spell prepared is answered here:
Prepared Spell Retention
Once a wizard prepares a spell, it remains in his mind as a nearly cast spell until he uses the prescribed components to complete and trigger it or until he abandons it. Certain other events, such as the effects of magic items or special attacks from monsters, can wipe a prepared spell from a character’s mind.
And again, on describing how copying spells from a spellbook and replacing a spellbook works:
A wizard can use the procedure for learning a spell to reconstruct a lost spellbook. If he already has a particular spell prepared, he can write it directly into a new book at the same cost required to write a spell into a spellbook. The process wipes the prepared spell from his mind, just as casting it would.