The <ğ> used to be pronounced, as a [ɣ]. It has dropped out in Modern Standard Turkish, though it survives in Turkish dialect, and in Greek loanwords from Turkish. So yoğurt used to be [joɣurt], which was transliterated as yoghurt. The /g/ is pronounced in that transliteration, because that’s the default thing to do in languages that don’t have a [ɣ].
I just said that Greek keeps [ɣ] in Turkish loans; so ağa = αγάς, bağlama = μπαγλαμάς. But in the case of yoghurt, the Greek form is γιαούρτι, which corresponds directly to yaourt, and has no <ğ> in sight.
The Triantafyllidis dictionary’s explanation (Λεξικό της κοινής νεοελληνικής) is that the yaourt variant has dropped the <ğ> earlier than standard Turkish did, either because it was Balkan Turkish, or because the <ğ> was dropped in Aromanian—for which their evidence is Bulgarian yagurt vs Romanian yaurt.