So, Turkey has applied for membership in the EU several times, but unlike Greece, it never seems to get in. What are the reasons that the EU has given for denying membership to this large and influential country?
Turkey has a population of 75+ million and if the country entered the EU today, they would be the second largest member state behind Germany. This would mean an instant shift of power in almost every EU institution, more notably the European Parliament where seats are distributed to member states according to population. Turkey would instantly become a key player in European politics and would have more influence than the traditionally core countries, France, Italy, and the UK. Even if we don't consider anything else, it's understandable that Europeans would be wary of a membership that would significantly alter the EU's political and demographic map, and Turkey's massive population is often quoted as the key political reason the country's accession process is under such heavy scrutiny.
Furthermore Turkey is not generally considered a part of Europe. It's the spiritual successor to the Ottoman Empire, an empire that was traditionally adversarial towards Europe, and its population is predominantly Muslim, while Europe's population is overwhelmingly Christian. A very small part of the country's territory, East Thrace, is in Europe and it's application may seem unlikely to be denied on geographic grounds, like Morocco's was, but still the question of whether Turkey should be considered a European country or not has been raised multiple times. A recent example is the following statement by Nicolas Sarkozy:
The statement is from 2007, two years after the violent Paris riots, a time when feelings for Muslim immigrants in France and in Europe in general were generally unfavourable. While Europe has been traditionally welcoming to immigrants, in recent years there's a strong anti-immigration sentiment across all major member states, a contributing factor to the steady rise of nationalism in Europe. Germany's position in 2010 was less critical but also not particularly enthusiastic in regards to full membership:
Given Turkey's predominantly Muslim population and its geographic location, the EU does not want to risk an influx of Muslim immigrants, simply put Turkey's accession would open a backdoor to Europe for immigrants from Arabic and African countries, at a time when immigration is an extremely hot issue in European countries and several countries have recently implemented anti-immigration laws that would seem extreme and unjustified a decade ago. A recent example is the decision to open detention camps for immigrants in Greece, an extremely controversial decision that in local media has been compared to Nazi Germany's detention camps. While this might seem like a local issue, we can't ignore the fact that most illegal immigrants reach Greece (and thus the EU) through Turkey.
Moving on, there are two issues that can be blocking factors, the historically troublesome Greco-Turkish relations and Turkey's occupation of northen Cyprus. From the EC's 2005 Turkey Progress Report (page 9):
While Greco-Turkish relations have significantly improved in recent years, especially after the 1999 earthquakes that devastated İzmit and Athens, Greece reserves it's right to veto Turkey's membership at any time, especially since there are unresolved territorial disputes between the two countries. Greece did not intervene in the 1989 Davos proceedings, but it most certainly would have vetoed the negotiations if the EC viewed Turkey's membership favorably at the time.
The Cyprus dispute has been a core issue in Europe - Turkey relations since 1974 but it became a blocking factor since 2004, when Cyprus joined the EU. It seems highly unlikely that Cyprus will accept Turkey's full membership without a satisfying resolution, at least in the near future.
Turkey will not become a member of the EU, simply because no one wants it to.
There is no Turkish politician I can imagine who would cede power to Brussels to the extent EU membership would require. Structural changes since the 80s have done a lot erode Turks' inferiority complex when it comes to Europe.
In Europe, you can't find a core country where 51% of the population is comfortable with the idea that Turks might have equal status.
Occasionally, it was convenient in terms of domestic Turkish politics to look as if the government is doing its best to join the EU, but lately they have stopped pretending.
If you want to get bogged down in the details, you can always do a full blown analysis of this or that treaty. For a real understanding, however, you'd be wasting your time.
At the end of the 17th century, the Ottoman Empire came close to swallowing Europe. At the end of the First World War, the Europeans came close to splitting the entire Ottoman Empire among them. Therein lies the rub.
Immigration is a red herring: Various governments are falling over each other, trying to give visas to Turkish tourists. For a lot of people in the Middle East, Africa, and Asia, in addition to the former Soviet Union, Turkey itself is the final destination of their illegal immigration journey.
Cyprus is a red herring since reunification was rejected by the Greek Cypriots in 2004.
For the last three decades, I have advocated the position that there is nothing in Europe but a crumbling centrally planned economy. Turkey and the Turks, trying to shed a statist, stagnant, centrally planned past, have no use for that.
The biggest current stumbling block relating to Turkey's accession to the EU is around the dispute over Cyprus.
Turkey refuses to implement a trade pact between Turkey and the EU that requires the Turkish government to allow Greek Cypriot vessels to use its air and sea ports, going against the customs agreement Turkey signed as a precondition to start EU membership negotiations.
The Republic of Cyprus, although an EU member, is not officially recognised by Turkey and Turkey has stated it will refuse to recognise it until such time as the removal of the political and economic blockade on the Turkish Republic of Northern Cyprus - an area which is not recognised by any state but Turkey itself.
This situation has prompted the EU to freeze negotiations on eight chapters of the acquis communautaire, negotiations which are required to be completed before EU member states can vote on the accession. Even without this freeze, only one chapter is considered to be completely aligned to acquis, with the majority requiring some to a lot of further effort.
There are several reasons, but in reality Turkey herself does not make enough efforts.
There are multiple tension points in EU-Turkey relations, for most of which Turkey avoids discussion.
The most difficult being the continued occupation of Cyprus.
Also it is quite doubtful to which extent Turkey is geographically and culturally European. It is the only country applied for EU membership whose capital is not in Europe.
There are many reasons, most mentioned above.
Another factor is the chaos around the middle east area, with death squads and mercenaries roaming about, smuggling, kidnapping, blackmailing and fighting.
The EU would suddenly be right on the border of destabilized countries - you can already see that this creates unnecessary tension, just look at e. g. the Ukraine and their conflict with Russia. What is the gain there?
The same situation you can see in Turkiye, where they support the ISIS against the Kurds, and as a threat against Syria causing immense damage to the infrastructure, and of course to the people too. It already is a mistake that Turkiye is a part of NATO - in the long run the EU will have to replace the NATO membership with its own military defence, without any outside treaties allowed - hence, no NATO membership anymore. Those who wish to retain this like the UK will have to leave the EU rather than continue to play trojan horse.
The people of the EU do not want to be a part of said conflict, but they would have to assist Turkiye if Turkiye would become a part of the EU.
This, and all the other reasons above, are what will keep Turkiye out of the EU.
They will have to form their own Arab union.
Other answers have provided some good reasons why Turkey will probably never become a member of the European Union. But it's important to realize that the EU is not actively “keeping it out”. Unlike some earlier ones (including the first bids by Spain or the UK), Turkey's application hasn't been vetoed or rejected. There is an accession process, with some slow progress and a lot of issues to work out, including of course the situation in Cyprus. Every once in a while, something happens, the process is frozen, restarts, a chapter gets opened, etc. but it's still officially on-going, possibly even useful independently of the final outcome.
At this point it seems exceedingly unlikely that Turkey would become a full member in the foreseeable future and it's unclear whether it really wants to but the day of reckoning when either side needs to give a definitive answer or to find some pretext to block accession seems very far in the future.
More broadly, the time for bold changes and ambitious projects seems to have passed. Many innovations from the Maastricht treaty can arguably be regarded as failures. The Common Foreign and Security Policy is moribund, the police and judicial cooperation (the former third pillar) does not work too well and the Euro has been in an almost continuous state of crisis for half a decade now (which should be obvious no matter your take on the responsibilities and the way forward).
The last major enlargement happened in 2004/2007 as a sort of delayed result of the fall of the Soviet Union and is still heavily debated in several member states. The convergence that was hoped for is far from complete and there are still many tensions because of that. On a more procedural level, the last major treaty was the Lisbon treaty in 2007, itself a “repackaging” of the “Treaty establishing a Constitution for Europe” that was discussed and negotiated before the enlargement (some representatives of the future member and candidate states did however participate in the Convention).
So the last decades have seen several waves of enlargement and several important treaties but with so many things not working well, so many member states pulling in different directions and so many players at the negotiating table, it's difficult to see anything major (including accepting a large new member) happening today.
One point that has often been mentioned, but not here, is the issue of human rights in Turkey.