MATLAB: Applying Inverse Fast Fourier Transform to an array of real numbers
Since $\vert X_1 \vert$ is a real even function, its FFT (IFFT) is a real function. This is a basic property of Fourier transforms.

The power spectrum can be real but not even, in which case the ifft will give complex coefficients. In the example you linked, they start with a non-even real signal and then take the FFT. This will give complex values coefficients for the FFT. The answer then says that


  The problem is that we have only our log-energies, no phase
  information, so after applying the ifft we get complex-valued
  coefficients


So, after taking the FFT, the phase is discarded, and this loss of information makes it impossible to get back to the original real signal. (The Fourier transform is bijective). Once the phase is discarded you have a real but non-even function, the IFFT of which will yield complex coefficients.