For various reasons (confessional and otherwise)Turkey has been firmly and outspokenly anti-Assad since the early demonstrations and since they evolved into civil war.
Russia has intervened effectively on behalf of the Assad regime. Since the Assad's failure today would almost certainly result in a jihadist Syria, this is not looking so terrible to the rest of Turkey's NATO allies, like France. Turkey is by some (fairly loose) definition engaged in proxy war with Russia.
At the same time Lebanese, Iraqi & Syrian airspaces to their south and east are free-for-alls with 8 national forces bombing as they see fit in Syria. This is probably making Turkey paranoid about their own air space.
I suspect they see/saw this as Russia testing their resolve to defend their border. There have been previous violations and stern warning had been made. There's also the possibility that this is a bad decision made by field officers in the short decision window they had.