I'm afraid my first WAG on this may turn out to be the facts of the case.
Long day, lots of stress, (maybe) a new/inexperienced site commander sees a blip on the scope doing a very fast climb coming directly for him (all bits I've picked up from various posts during the past couple of days)...and he pulled the trigger on a plane full of civilians. (I've seen worse in simulated situations like that back in The Day)
One other factor that may apply here is something I noted during GW1 when Baghdad was first being bombed: Anti-aircraft guns were just blazing away spraying rounds in all directions and I guessed (it turned out correctly) that the rocket sites were doing exactly the same.
The reason?
There was a pretty good chance that if Baghdad was going to take any hits at all, any Iraqi AA site commander who didn't claim a dozen or more enemy aircraft downed or hit with empty ammo lockers and/or launch racks to back up the tale was going to have a very bad and possibly fatal postaction debrief.
Something we used to call "Same [****], different day" would seem to have applied for Tehran.
And that 737 was just in the wrong place at the wrong time for all involved.