I think it could be some sort of social signal. So our primitive foraging ancestors, watching each other eat a foreign substance like a bitter plant, could learn it is bitter without having to eat it themselves.
My knowledge of this comes from the very scientific and fair television program; Brainiac!!They did an "experiment" looking at tatses of different food, including sour foods, hot foods and bitter foods. The explanation given for the grimacing associated with sour foods was that sour foods are usually highly acidic (such as lemons and limes). The acids need to be diluted (presumably to prevent excess stomach acid?). To do this you rub your cheeks on your gums to encourage production od saliva which dilutes the acid. An amusing side effect of which is the grimacing and gurning!!Mark
Regarding the bitter sensationste, I would guess that it relates to foods that can be harmful to one's health, which often taste bitter (ie , mould). It is a warning signal to spit it out. Sweet and salty, implying salt and sugar, both of which are necessary, are "positive" taste sensations, encouraging us to consume them.Another sensation usually positively perceived could be "roundness" or "fattiness", because this would be associated with high energy density,thus desirable. These are products of evolution, just like the sensation of pain. Organisms not having that sensation would not last very long, and would not be likely to reproduce.
Foods of a bitter, sour or extremely sweet nature seem to have an effect just behind my ear lobes. It is more like a chemical reaction causing a physical sensation which then seems to make me pull my cheeks and lips back to relieve it.