I'm not at all an expert, but here's my guess as to the basic situation:
The number of Iranian personnel behind this is pretty small. Perhaps the crew of a single mobile unit. They are only partially trained. They were given the most basic directives, which they interpreted as, "Shoot at whatever crosses into your zone." They were not capable of seeing the bigger tactical picture, because they had limited equipment and/or limited knowledge of the equipment. I'm guessing their mobile unit was meant for a limited area of a hot combat zone, not for the general defense of a large area, and lacks the capability to provide a big picture.
They are basically incapable of abstract thought, but were not given the training and procedures to guide them through a complex scenario. They should have been given specific and simple directives from a sophisticated, interconnected system of specialized units. But either they had no effective communication with such a system, or there was no such system. They were on their own.
They may have been either seeking glory, or scared of not following orders and letting something through. And they were over-tired from being on constant alert for days on end. (Or they could have been third rate replacements for a first line but exhausted crew.) The limited range of their weapon put extreme time constraints on them. They had no time to put together any real awareness of the situation.
All this means that the direction of travel, speed, altitude, etc. - or even transponder - meant nothing to them. They had no way to realize it was a commercial airliner that had just taken off from a local airport. It was just something in their zone.