Understanding the nature and characteristics of the intrinsic defects and impurities in the dielectric barrier separating the ferromagnetic electrodes in a magnetic tunneling junction is of great importance for understanding the often observed 'barrier-breakdown' therein. In this connection, we present herein systematic experimental (SQUID and synchrotron-radiation-based x-ray absorption spectroscopy) and computational studies on the electronic and magnetic properties of Mg1-xFexO thin films. Our studies reveal: (i) defect aggregates comprised of basic and trimer units (Fe impurity coupled to 1 or 2 Mg vacancies) and (ii) existence of two competing magnetic orders, defect- and dopant-induced, with spin densities aligning anti-parallel if the trimer is present in the oxide matrix. These findings open up new avenues for designing tunneling barriers with high endurance and tunneling effect upon tuning the concentration/distribution of the two magnetic orders.