The last sentence is true.
On the S400 matter cited many times through this thread: Turkey only bought S400 after trying for more than a decade to get any missile defence option from anybody, including Americans themselves (they did not agree to sell them MIM 104F *,) French, Germans (both French, and German deals were sank under US pressure,) Taiwanese, Chinese, Indians, and Israelis.
* USA warmed up to selling Patriot to Turkey few years ago, but that ship has long sailed, with S400 deal being inked years prior.
Turkey, be them a wayward ally, but their feelings of being constantly wronged by the USA, NATO, and EU, and not being truly treated as a peer are fully genuine.
So, yes. They do this to slight USA, just like they bought S400 to punish USA after them really being trolled, for the lack of a better word, by 3 US presidents, along with NATO EU allies.
And it did so after a decade of trying to get Turkey into EU, while he still had an image of a popular, liberal, progressive, more European minded leader, and possibly even been such to some extend, before he crossed the red lines.
Back then, French blocked every attempt of their accession on a complete pie in the sky grounds, because they didn't like Turkey for them competing with them for influence in Africa, and Arab world. This was at the time when even Greeks agreed to greenlight Turkey's accession
Now the ship has long sailed, relationship are more sour than ever, EU really needs Turkey on its side more than ever, and they regret every second allowing Sarkozy pulling his shenanigans.
This truly could have been avoided if EU was able to police its wayward leaders better.
Consider Turkey's politics:
It's 2003 and RTG comes to power on a gazillion of promises with a historic election victory of a party which wasn't part of Turkish L'Ancien Régime for the first time ever.
The party is nominally Islamist, but of a garden variety. Essentially they are a party of rural Turkey, and they try hard to put something on the table in urban areas. What they put on the table was EU accession.
For a first time, everything goes almost too good to be true. Economy is booming, population is euphoric. The EU accession protocol was initiated, Turkey does a lot of reforms, and concessions to EU. Even the impasse with Greece gets seemingly close to resolution.
And then... as if somebody slams the lid on the piano. Sarkozy pops up like a genie out of a bottle, and a tectonic shift starts in Europe. Then 2008. Then troubles on the Southern border. And then the Lira flies.
RTG now has to choose way for survival for his himself, and his party. He considers what he can still sell to the electorate.
To keep banging his head at EU's door, knowing that the this door will be closed for the foreseeable future, and that pro-EU electorate will leave him, that it's an increasingly unpopular with his core electorate, and that this is a near certain losing move, or do a 180°, and turn towards increasingly more loud whispers in his core electorate of turning towards "proper Islamisms," and overall more hardcore right politics — something which sustained previous regimes in Turkey without fail (or at least did until the next military coup.)
This is how I see it.
Greece really had no better option than to bury the past conflict with Turkey back then.