I think the reaction to spellcasting is sometimes overblown but that's a GMing or player metagaming issue, not a game or setting issue.
If someone casts a detection spell that A) doesn't harm anyone or B) doesn't seem to have any annoying or visible effect after the casting is over, then you're going overboard if you make that NPC react the same way he/she would by seeing someone pull a knife or a crossbow.
The GM should have the NPC question the PC, i.e. "Hey pal, what are you doing?" but to go to violence immediately is a metagaming reaction.
PCs must also behave more realistically in many situations. For example, the PC should herald his spellcasting to any NPC by asking permission or at the very least, asking for forgiveness after the fact. Make good use of that 'talking is a free action' feature of the Pathfinder game.... it can prevent fights or death in many situations! :)