Turkish support - at least 'tolerance' of the Daesh's activities in Turkey and along its borders inside Syria - is related to the general Islamisation of the Turkish society, strongly supported by its government and... well... many of the people who voted for that government:

For some Turks, Islamic State proves a ‘family-friendly’ draw
...Dozens of families are crossing into Syria to live, in hope that extremists’ religious rule will protect children from Western
influence...