Turkey has cut off close relationships with Israeli intelligence agencies. This relationship has been useful in shutting down Islamic terror organizations. But the Turkish government is run by an Islamic party that seeks better relations with Islamic states, especially Iran and neighboring Arab countries. So the Israeli connections have to go.
Meanwhile, military commanders in Turkey and Israel appear to get along better than their respective governments. But this does little good when Turkish politicians grow increasingly anti-Israel. Recently, Turkey declared Israel to be a threat, while Iran and neighboring Arab states were considered no problem. Turkey is severing the many ties with Israel that have existed for over half a century.
The Turkish government has become increasingly anti-Israel in the last six years. Islamic politicians, who were elected in 2002, have adopted an anti-Israel, anti-West attitude, and use this to increase their stature in the Islamic world. This is a return to the past. Until 1924, the Sultan of the Turks was the Caliph (technically, the leader of all Moslems). But in the 1920s, Turkey turned itself into a secular state. Although Turkey became a major economic power in the Middle East, with one of the best educated populations in the region, it was still hobbled by corruption and mismanagement. The Islamic politicians promised to attack the corruption (which they have) and return religion to a central place in Turkish culture (a work in progress). This has upset a lot of secular Turks. But it's fashionable to hate Israel these days, over their efforts to cope with Palestinian terrorism.
The Turkish Army has always been more secular. It was Turkish officers, led by general, and national hero, Kemal Ataturk, who carried out the secularization program, and began building good relations with the West. Many Turkish officers see the current government trying to undo what Ataturk started, and they are not happy about it.
But Turks are also concerned about their rebellious Kurdish minority, and this led to closer relations with Iran, a nation that openly calls for the destruction of Israel. Four years ago, Turkey and Iran established a bilateral commission to combat Kurdish separatist rebels. In effect, the two countries cooperated to fight the Kurdish rebels, in the form of the Turkish PKK rebels and the Iranian PEJAK. In addition to sharing intelligence, there were some joint operations, with Turkish and Iranian forces operating together against Kurdish separatist gunmen and bases. Apparently this hurt PEJAK enough so that the organization renounced armed violence, and turned more to political activism to improve conditions for Iranian Kurds. This can be interpreted as an effort to build a stronger base of support, before returning to armed resistance. But it still counts as a win for Iran. However, there's a catch. PEJAK also wants to develop closer relationships with the PKK, which is still battling the Turks. Apparently PEJAK has not renounced violence forever.
There are seven million Kurds in Iran, six million Kurds in Iraq, two million in Syria, two million in Pakistan about 14 million in Turkey and another two million scattered around the world. Despite thousands of years of efforts, the Kurds have never been able to establish their own Kurdish state. Turkey wants to keep it that way, and considers their Kurdish problem more important than any disputes they may have with other states in the neighborhood.