"Side-effect of other things" is certainly one answer. The "fight or flight" response starts with a big shot of adrenaline, which puts the sympathetic nervous system into overdrive. This causes bandwidth problems for the central nervous system - no, seriously - and the signalling rate from the internal anal sphincter to the central nervous system drops suddenly, which in turn causes the sphincter to relax.
This mechanism would seem to be a straightforward side-effect.
There's another part to this though; adrenaline has an effect on the external anal sphincter, causing it also to relax and one's bowels to involuntarily evacuate through peristaltic contraction. This latter effect makes me wonder if there could be survival advantages to the response.
Conjecture 1) The sudden evacuation of faeces and the accompanying odour act as a signalling mechanism to nearby members of one's own species that a threat is at hand...
The problem with this idea is that the overwhelming response in mammals to the smell of faeces (particularly of one's own species) is disgust. Soiling yourself when the tiger leaps out of the bushes is more likely to send people downwind of you scurrying off in the opposite direction, not running to help.
Conjecture 2) If you reek of poo, you don't smell like a good potential meal...
Possibly, although mammals - and in particular, carnivores - show a decreased level of disgust response to faeces produced by species other than their own.
Conjecture 3) It makes you lighter and you can therefore run away faster...
This is too silly for words.
I'm going with:
Conjecture 4) Sometimes, sh*t just happens!