They pushed for EU membership when their economy was in shambles. It seemed like an economic necessity for which they were (sort of) willing to make changes.
The opinions within the EU itself were always diverse, but what counted is that Turkey was a strategic and economic asset. Moreover it was a place where the EU could 'do good' with their superior moral values (sarcasm intended).
The first contribution of the EU was to keep the AKP in power. Every previous Islamic party was either outlawed of removed from power by the military. Both the army and the supreme court decided against that, because that would mean Turkey would never join the EU (which they needed at that time).
Turkey dragged its feet in making changes, likely because they were not so convinced the EU has superior morality. Meanwhile Turkey rebounded economically and the role within the region grew. It also saw Romania a Bulgaria admitted into the EU while these countries did not even live up to the economic demands of joining.
When Erdogan took full control, several things happened. Corruption went rampant and civil liberties were restricted. The country is being islamized. These things led to the Gezi Park protests and a diminished confidence from investors. Funny thing is that the more progressive part of the population only now starts to realize that EU membership could result in better civil rights.
Meanwhile the EU keeps broadcasting mixed signals. They criticized Erdogan but let him get away with attacking and lying to him own people. France and Sweden are among the strongest advocates of Turkish membership. Sweden has the strongest civil rights tradition and France has the strongest separation of church and state. The idea still seems to be: "when they come into contact with our superior standards, they will change accordingly".
My opinion? That is an arrogant thought and it will not work. It did not work for immigration waves and it certainly won't work for 75 million Turks. The EU will not change Turkey, but Turkey will change the EU.