I'd like to congratulate the Wall Street Journal for running a recent opinion/analysis piece on the mysteries of yawning.
In particular, the big one: "why is yawning contagious." People say, "the power of suggestion" but that sounds like a merely verbal answer, a bit like the claim that sleeping pills work because of their dormitive efficacy.
A better approach, says the WSJ, is to think about survival effects. Yawning may have evolved as a way in which an organism maintains its alertness. It doesn't merely mean you're tired, it means that you are tired and recognize that you should be awake (in some non-moralistic sense of the word "should" of course.)
This in turn suggests that the urge to yawn could well be triggered by the yawn of someone nearby. After all, alertness is a trait that small groups in close proximity often need to maintain together. They have common predators, or common prey, about.