It should come as no surprise that a young, inexperienced government, would be intimidated by what they feared ...being "locked out of Europe". Given the seeming Euro-wide opposition to the US, Turkish officials were forced to make a choice they were ill-equipped to make.
I'm not excusing Turkey's decision, but there were other pressures that should be considered. Their government now realizes this great mistake and seem to be making efforts to make amends.