The reason that many Turkish poets composed their poems in Persian comes from the fact that Turkish language has difficulties with the Arabic script and poetry.”Aruz Meter” (وزن العروض) is unsuited for the particular structure of Turkish language that does not make distinction between long and short vowels.
{Later some poets like Amir Alishir Navai who was born and lived in Harat (15th century) solved the problem with changing the structure of Turkish words (Qara became Qare, Yara became Yare and so on) and using many Arabic and Persian words specially for therhymes.}
There have been two kinds of poetry in Turkish literature;Arabic (Aruz; Qasida, Masnavi, Ghazal, Rubai, and so on) and Turkish Poetry(Hija; Bayati, Qoshma, Gerayli, and so on). However, there has been only one poetry in Persian language which is originally Arabic poetry of Aruz. Unfortunately, Turkish poets were not able to write their poems of Turkish poetry since at the time that was considered to be the poetry of infidelity.Turks have kept this heritage by Turkish folk songs.
So please note that, Writing in one language should not be associated with ethnicity! as simple as that! I am writing this text in English but I am Azerbaijani Turkish! The fact that all remaining poems by Nizami is in Persian does not make him Persian! Iran’s ‘finest living writer’ Dr. Baraheni has all his work in Persian(he is a Turk and always speaks up for his own language). Nasimi wrote in Arabic, Persian and Turkish! Finally, the most internationally well known writer, now, in the Republic of Azerbaijan,Cingiz Abdullayev(and many others) write in Russian! people chose to write in one language in order to expand their audience! I am writing in English now so more people can understand it! In 7th century ethnicity did not matter. those times what mattered the most was religion! In order to expand their audience,the most Azerbaijani Turkish writers and poets choose to write at least some of their work in Persian and Arabic! had they known that one day their language of choice will be used against their own people to marginalize them and deny their identify, I am sure some poets, would have given second thoughts to their decisions!