It is a combination of multiple factors by which the "better writers" decide on how to write words. To look good and/or educated by using kanji to write a word, it would have to meet at least a couple of the following criteria.
1. It is commonly written in kanji in the majority of the printed media.
2. The kanji version is actually taught in schools.
3. The word was borrowed from Chinese.
The word 「あくび」 is an originally Japanese word as you could probably tell from its sounds. Its kanji version 「欠伸」 does not exist in Chinese. In addition, 「欠伸」 is not taught in schools or used in the "better" printed media. It is simply not in active enough use. Why write in kanji the words you grew up seeing written in kana?
Unless this particular writer is a kanji wizard, he would have written the word in hiragana if he had been handwriting his manuscript. It is often with the help of the wordprocessor (or the PC) that people nowadays tend to write more words in kanji than they did before the computer age. This phenomenon was bound to occur because there is something of a nationall consensus that the more kanji one uses, the more intelligent it makes one look. Unfortunately, though, some people are not aware that writing certain words in kanji will only make them look less educated instead to the better readers and writers of the Japanese-speaking world.