Turning to look at something without any genuine need is disliked, for it is against the etiquettes of humility while facing Allah in Prayer.
‘Aishah says: “I asked the Messenger of Allah about turning in salah and he said: ‘It is the portion that the Satan steals from the slave’s prayer.'” This is related by Ahmad, al-Bukhari, an-Nasa’i, and Abu Dawud.
Abu ad-Darda’ narrates from the Prophet: “O people, be careful about turning for there is no salah for the one who turns. If you must do it, do it in the voluntary prayers and not in the obligatory prayers.” This is related by Ahmad.
Anas relates that the Messenger of Allah said to him: “Be careful about turning during the salah as turning in the salah is disastrous. If you must do it, then do it in the voluntary prayers but not in the obligatory prayers.” This is related by at-Tirmizhi who calls it sahih.
In the hadith of al-Harith al-Ash’ari, the Prophet sallallahu alehi wasallam said: “Allah gave Yahya, son of Zakariyah, five commands that he was to abide by and was to order the tribe of Isra’el to abide by…” One of them was, “Verily, Allah orders you to pray, and when you pray, do not turn for Allah looks to the face of His slave in salah as long as he does not turn.” This is related by Ahmad and an-Nasa’i.
Abu Zharr reported that the Prophet said: “Allah faces the slave while he is in the salah and keeps facing him as long as he does not turn. If [the slave] turns, [Allah] turns away from him.” This is related by Ahmad and by Abu Dawud who said its chain of narrators (isnad) is sahih. The preceding hadith is concerned with turning the face during the salah. If one turns the whole (upper) body away from the qiblah, then the salah is invalidated, for not fulfilling the requirement of facing the qiblah. On this point, there is no difference of opinion.