Remember that a mouth isn't used solely for digestion: it is also used for communication, breathing, and taste.
Because it is used for taste--and because of how important taste can be--it was better off near the brain, like the ears, eyes, and nose. In order to shorten the time it takes for sensory information to reach the brain.
Because it is used for breathing--in conjunction with the nose, which it should then be close to--it is above the lungs, which in turn benefited from being near the heart, which was better off in the upper body.
Because it is used for communication, being near the eyes, ears, and nose is also good. Since eyes are used in non-verbal communication; since ears being near the mouth make it easier for both parties to hear each other at the same time (imagine if ears were at the top of our bodies, and our mouths were on the bottom; how would we whisper to each other?); and since the nose plays a role in speech, it has to be close to the mouth.
Also, the mouth plays a role in digestion, in the teeth and saliva. Some people believe that the length of the esophagus actually contributes to digestion. And even if it doesn't, it could be argued that its length could help to prevent us always having escaped bile in our mouths.
Maybe all of these things didn't contribute to the constant placement of the mouth away from the stomach, but just a few could explain why bodies are designed the way they are, as evolution organized them to be as economical as possible.