I know my question reads like something that would be in a 12th grade history class, but I am kind of curious and I wouldn't know where to look for reliable information on the subject.
I'd say there were three main factors dictating the Turkish entry into the war. The first, and more paramount, is that the Ottomans and Russians did not get along. Russia had, for the previous two and some centuries, been slowly eating away at Ottoman territory, either directly or by undermining their authority (such as freeing the Balkans). The most recent case of this was the war of 1878/1888 between the two, but anyone with a brain could see that, given the opportunity, Russia would continue to encroach on Ottoman territory. It was no secret that the Tsars desired control over the remaining Othodox population centres in the Empire, particularly Constantinople. At any rate, in Turkish minds, this could very much be seen as anything from a preemptive war of defense to a war of revenge, or somewhere in between those two.
Second, you have the relationship between the Germans and Turks. Germany was a heavy investor in the Ottoman Empire, garnering them heavy favour, most prominently in the form of the under-construction railway to Iraq. Germany was one of the few European powers that had no interest in Ottoman territory, and was a clear and powerful rival to the main threat to Ottoman security, the Russians.
Finally, we have the influence of the ambitious. There is some evidence to indicate that much of the civilian government and bureaucracy of the Ottoman Empire was against both the alliance, and entering the war in general. After more than four decades of almost continual war and struggle throughout their territory, both against invaders and rebellers, but also political dissenters and reformists, the Empire was not really in any shape to take on the Russians, let alone the rest of the Entente. Hell, the Russians made them look organized and well equipped, and that should tell you something about the situation facing the Turks. However, certain individuals, and the military itself, were very jingoistic, whether for national gain, or attempts at usurping power for themselves from the bureaucracy. Regardless, the Alliance itself was fait acompli with no-one in the civilian administration powerful enough in the face of military support to counter it.
EDITED: words.