Hey fens!
Your turrets are set to target the "First in range" and they are all "in range" at creation. Thus, all units are targeting the light blue unit (UID=1), including itself. Since you check the team right after acquisition of the target, the four members of the light blue unit's team are unacquiring it. So, only the top four units fire, as they're the only ones that have a target.
Also, no matter which method you pick for targeting (First or Nearest), if you use one type of unit for both teams you'll always end up with units targeting themselves.
In short, you MUST use diferent units (or families) for different teams or else it won't work.
Hope it helps. Cheers!