It is likely that the choice of route is made based on financial reasons. From looking at recent flights, Emirates seems to have a preference for flying over Iraq, but occasionally flies over Iran. The ATS overflight fees of Iraq are at $3751 (approx. $0.38 per km) considerably cheaper than those of Iran.