Ottoman Turkish was overloaded with Arabic and Persian borrowings to the point that they were influencing its grammar. If a noun and an adjective were both of Arabic origin, they had to agree in gender, something completely foreign to Turkish, a language without grammatical genders. It means people had to know the original genders that those words had in Arabic. It wasn't probably a problem as many were studying Arabic, which was the language of religion. And that's my next point. All the educated people knew Arabic, the empire was the Caliphate, they used the religious identity, not the national/ethnic one, the Arab lands were part of the country, and many citizens were Arabs. It would have looked perfectly logical if they had completely switched to Arabic. Why didn't they do so?
Ottoman Turkish evolved over the centuries and took many forms - if you read the works of Âşıkpaşazade from the fifteenth century you'll find that it's very different from seventeenth century works. The literary and bureaucratic language of the fifteenth century was much more "Turkish" than that of the sixteenth century, and by the seventeenth century multiple diverging styles had emerged. Authors who wrote in Ottoman Turkish had a great deal of flexibility - they could vary between a simple and easily understood style (e.g. Temeşvarlı Osman Ağa), an educated and sophisticated style (e.g. Naima), and a complex, poetic style totally infused with Arabic and Persian (e.g. Karaçelebizade). If you speak Turkish I can give you some examples of this. Switching entirely to Arabic or Persian would mean abandoning this flexibility, and adopting a language which only highly educated people would understand. Lots of Arabic and Persian works were translated into Turkish during the sixteenth and seventeenth centuries, indicating that a significant proportion of those who were literate were not comfortable with those two languages, or at least preferred to read in their native Turkish.
As for literary 'high culture,' by the mid-sixteenth century Turkish had developed prestige as a literary language to rival Arabic and Persian. While rulers like Selim I patronized works written in Persian, under Süleyman Turkish came into its own, and was no longer seen as inferior. While many religious treatises were still written in Arabic, the court's literary output was largely Turkish from the mid-sixteenth century onward. There was just no incentive to abandon this tradition by switching to another language.
All the educated people knew Arabic, the empire was the Caliphate, they used the religious identity, not the national/ethnic one, the Arab lands were part of the country, and many citizens were Arabs. It would have looked perfectly logical if they had completely switched to Arabic. Why didn't they do so?
I think you're overstating this by quite a lot, and in some cases have it a bit backwards. In the Ottoman empire, the elites in the Arab territories, like Egypt, spoke Turkish, and had in many instances done so long before the Ottomans had ever arrived on the scene because it was the language of the Mamlukes.
This also overstates the extent to which the empire was a "Middle Eastern" or Arab one. It may certainly have looked that way in 1913. But the final years of the Ottoman Empire were an aberration in that regard. The Ottoman Empire was a Balkan and Anatolian empire long before it was an Arabian one.
Its most talented leaders often came from the Balkans (in which I am including their Greek territories):
To give just a few examples.
Moreover the Jannisary corps, and its recruitment through the devshirme, was largely recruited from the Balkans. This corps formed not only the military bulk of the empire but also its administration as well.
they used the religious identity, not the national/ethnic one
I'm not convinced that this is true, the Ottoman identity, which clearly had elements of culture and language if not strictly ethnicity, was a critical part of their rule.
I think also given that lack of ethnic centralization or nationalization (at least until the later Turkification policies) its worth bearing in mind that the empire was perfectly capable of governing its Arabic territories in Arabic while still preserving Turkish as the language of central government.
Ottoman Turkish was overloaded with Arabic and Persian borrowings to the point that they were influencing its grammar.
Influencing grammar perhaps, but not sufficiently as to reach any level of mutual intelligibility. I can read Arabic but Ottoman Turkish is unintelligible to me aside from a handful of loan words.