Turkey has been the victim of many terrorist attacks from ISIS and other groups based in Syria. The wall is security, to better protect Turkish citizen.
The ficticious Mexican Wall is nothing to do with anti-terrorism or Security, it was an uncosted election gimmick.
From the Home Office travel information on Turkey:
// Extremist groups based in Syria including ANF (Al Nusra Front) and Daesh have the capacity to carry out attacks in neighbouring countries, including Turkey.
On 1 January 2017, there was an attack on the Reina nightclub in Ortakoy, Istanbul; 39 people were killed and 69 injured.
On 10 December 2016, a car bomb exploded near the Besiktas football stadium in the Macka/Dolmabahce area of Istanbul. 44 people, mostly police officers, were killed, and over 150 injured.
On 24 November 2016, a bomb exploded near the Governor’s office in Adana. 2 people were killed and 21 injured.
On 14 October 2016, a rocket attack took place on the outskirts of Antalya towards Kemer; no casualties were reported. Separately on 14 October 2016, attacks also took place against the Turkish military in Hakkari, Diyarbakir, Van and Adiyaman resulting in 13 injuries to service personnel
On 6 October 2016, an explosion occurred near a police headquarters in the Yenibosna area on the European side of Istanbul
On 24 August 2016, a roadside bomb injured 2 Gendarmerie officers on the Antalya – Kemer road near Topcam.
On 20 August 2016, an attack on a wedding party in Gaziantep killed more than 50 people and injured around 100.
On 28 June 2016, Ataturk International Airport in Istanbul was attacked. More than 40 people were killed.
On 7 June 2016, a bomb attack in the Vezneciler area of Istanbul killed 7 police officers and 4 civilians. 36 people were injured.
On 1 May 2016, a bomb attack at the Central Police Station in Gaziantep killed two police officers and injured 23 others.
On 27 April 2016, there was a suspected suicide bomb attack at Bursa Ulu Mosque. The bomber was killed and 7 people slightly injured.
On 19 March 2016, there was a suicide bomb attack against tourists on Istiklal St in Istanbul, in which 4 tourists died and at least 36 people were injured.
On 13 March 2016, a bombing in Kizilay Square, central Ankara killed more than 30 people.
On 17 February 2016, a large bomb attack near a military barracks on Eskisehir Road in Ankara killed 28 people.
On 12 January 2016, a suicide bomb attack in Sultanahmet in Istanbul killed 10 tourists. //