Well Turish establishment before and after Ataturk has always been secular and not an islamic conservative regime. So it's normal that Turkey has friendly , neutral or friendly relations with Israel depending on the situation or geopolitical realities. So turkey has been quite pragmatic in it's foriegn relations since then.
However Erdogan recent tilt towards showing an Islamic front in its dealing with others and shoeing his political credentials has been called into question yet again with this crisis by accepting Israelis aid workers to be dispatched in Turkey.
As i said religion doesnt often adhere to rationality/pragmatism. So you cant look at Turkeys actions from a religious point of view, since it wont make sense.. To be honest though, every religuous led country in the world actions can't be look at from a religious point of view since their actions wont match their religious nature/beliefs. Since if tou want to live by the scriptures then you wont have relations with almost no foriegn power who doesnt adhere to your faith or whose values goes against your faith. In short it's impossible to live like that today. So no country does it. Afterall, how many peole can really practically be ready to give their life(and that of their family) for their faith. The very few who are ready to do so are considered (rightly so) as extremists.
Else Iran wont have good relations with Atheist China/North Korea or Orthodox protector powerhouse Russia, Islamic religious state of Pakistan wont have had non muslim power U.S and Atheist China as its biggest allies, KSA wont have western countries as its biggest allies etc etc. In short no religious country can claim to be a saint to be honest.. In conclusion a country ruled by religious doctrines , with a government who claims to represent Islam(or whatever religion) is all nonesense. Since none of them can do so feasibly.