Defects play an important role in the properties of metal oxides which are currently used as barrier layers in magnetic tunnel junctions (MTJs). We study the effect of O vacancies on the interlayer exchange coupling (IEC) and tunneling magnetoresistance (TMR) in Fe-MgO-Fe tunnel junctions. Measurements of IEC in fully epitaxial Fe-MgO-Fe(001) tunnel junctions show IEC is antiferromagnetic (AFM) for small MgO thickness but changes sign and then vanishes for large barrier thickness. First-principles calculations based on density functional theory demonstrate that the presence of neutral O vacancies (F-centers) in the MgO barrier can explain this behavior. Resonant tunneling through the F-centers makes IEC AFM for thin barriers but with increasing MgO thickness the resonance contribution to IEC is reduced resulting in the ferromagnetic (FM) coupling typical for perfect MgO barriers. First-principles calculations also show that O vacancies can affect TMR. F-centers produce occupied localized s-states and unoccupied resonant p-states in the gap of MgO. We demonstrate that F-centers affect the conductance by either resonant transmission or nonresonant scattering of tunneling electrons both causing a substantial reduction of TMR compared to the ideal case