This was (is) one of my biggest bugbears whilst learning QFT. The reasoning behind using a Fock space is actually really simple and intuitive for a scalar field (provided you are comfortable with standard QM) but it's always masked by the horrible concept of 'canonical quantisation'.
Take the Fourier transform of the Klein-Gordon equation:
$$
\partial_t^2\hat{\phi} = -\omega_{k}^2\hat{\phi}
$$
this is the classical equation of motion for a harmonic oscillator. There's one of these for every possible momentum (this corresponds to $\phi$ being a field over space transforming into $\hat{\phi}$ which is a field over momentum).
It's harder to transform the Lagrangian (since it includes terms like $\left(\frac{\partial\phi}{\partial t}\right)^2$), but one can assume it similarly describes $\hat{\phi}$ as an infinite spectrum of harmonic oscillators. Given this, it's reasonable to assume that the quantum Lagrangian/Hamiltonian for $\hat{\phi}$ similarly corresponds to an infinite spectrum of quantum harmonic oscillators. This we do know the form of:
$$
H = \int \frac{d^{3}p}{2E_{p}}a_{p}^{\dagger}a_{p},
$$
where I've dropped the zero point energy because you can (it corresponds to reordering the fields, which is an ambiguity that exists in going to the non-commuting quantum case from the commuting classical case) and it avoids the usual infinite-energy problems.
Now we just claim that $\phi$ has the same quantum Lagrangian as in the classical case and that the above Hamiltonian is the Fourier transform (of the Legendre transform) of the Lagrangian. If you work through you find that you get out the canonical form of the field. David Tong does this on page 24 of his notes, though he does it by essentially proposing the canonical form as an ansatz.
Then you just use your infinite set of annihilation and creation operators that arose naturally to generate the infinite set of QHO number states (one for each momentum). This is identical to the Fock space generated by the momentum operator, so you just treat it as a Fock space.
the integral
$$ \int_0^{\infty} e^{i\epsilon t}dt$$
is not-defined for $\epsilon \in R$. For your integral, Mathematica probably also gave you the condition that ${\rm Im}\{\epsilon_\lambda - \epsilon\} < 0$. For real frequencies, we have to add a small infinitesimal in order to assure convergence. Thus
$$ \int_0^{\infty} dt e^{i\epsilon t} \to \int_0^{\infty} dt e^{i(\epsilon+i\gamma) t} = -\frac{i}{\epsilon+i\gamma}$$
the physical meaning of this $\gamma$ is to give a finite life-time to correlations in the system. The limit $\gamma \to 0^{+}$ assures us that particles and holes (in non-interacting systems) have the limit of infinite life-times as they do not decay. Sometimes you will see that this $\gamma$ is replaced with some finite inverse life-time in a phenomenological style $\gamma \to \tau^{-1}$.
Also: the imaginary part of the Green function is associated with the density of states. Adding this infinitesimal and taking the limit of $\gamma \to 0^{+}$ give us a delta function, as desired. Upon replacing $\gamma \to \tau^{-1}$, in this context, the density of states attains a finite width.
Best Answer
First let me note that (up to how you've chosen to normalize the Fourier transform) the "Fourier transform" with opposite sign is actually the inverse Fourier transform. It doesn't matter whether you call the plus sign the transform or the inverse as this is entirely down to preference. The only important thing is that when you flip the sign you get the inverse transformation.
With that said, let me try and first give an example wherein the cause of the sign flip is manifest, then I will try and describe how this generalizes.
First of all, we can note that in a field theory specified by a Lagrangian, the momentum is not an independent variable (more on this later). Even in point particle mechanics this is the case. After all, the momentum of a free particle governed by Lagrangian $L = \frac{1}{2}m \dot x^2$ is $p = m\dot x$. So if we were to do a transformation to $x$ and expect this relation between the momentum and position to be preserved, a transformation of $p$ would be forced upon us: we would have no choice if we wish to preserve $p = m\dot x$. For an example of this, suppose $x$ is the position of a particle in 3 dimensions and apply a rotation to $x$, $x\rightarrow Rx$. Then we are forced to either transform $p \rightarrow R p$ at the same time, lest we violate $p = m\dot x$.
So then, consider a free complex scalar with Lagrangian $$ L = \partial_\mu \phi^\dagger \partial^\mu\phi - m\phi^\dagger \phi. $$ The conjugate momenta to $\phi$ here is $\pi = \partial_0 \phi^\dagger$. Hence if we wish to Fourier transform $\phi$, the transformation of $\pi$ is forced upon us and in particular there is a complex conjugation in the dagger which would flip the sign in the Fourier factor.
Of course, this may be all well and good in the special case of a complex scalar field, but based only on this example one could very easily question why a sign flip should occur if we are working with, say, a single real scalar field. In that instance there would appear to be no natural reason to have a conjugation. I mean, since everything is real we can always throw conjugations onto our field for fun, but there's no compelling reason to do so.
So this is where I would like to read further into the observation that we are preserving the relation between the field and its conjugate. So, let me point out that transformations which preserve the relation between field and conjugate are known as point transformations and, importantly, point transformations are a special type of canonical transformation (though not all canonical transformations are point transformations). Canonical transformations are precisely those transformations which preserve the commutator (or classically, the Poisson bracket). In other words, they are transformations which send conjugate pairs to conjugate pairs. As OP noted, demanding that the "Fourier transformed" variables be conjugate to each other in the standard way is enough to demand that the sign be flipped. This is how the sign flip comes about more generally.
There are two points, in my opinion, which one might wonder about at this point. Firstly, why should we restrict ourselves to only allow canonical transformations? Secondly, does allowing only canonical transformations uniquely determine that the sign must flip? That is, are there more general possibilities?
For the first point, the answer is essentially yes. We are completely free to consider transformations which are not canonical. However somewhat anti-climactically, it is typically not very useful to do so. There are some additional things involving generating charges which make canonical transforms a little more special, but I think that would go a little too far afield for this answer and at the end of the day, "non-canonical transformations tend not to be useful" is really the truth of the matter.
For the second point, no the transformation is not uniquely fixed. It is, however, probably the most natural choice. Particularly because it's the choice which makes the Fourier transformation a point transformation when we have free complex fields. The reader might be interested in looking at the Bogoliubov transformations for a somewhat more general type of transformation which mixes the plus and minus signs (of both the field and its conjugate). These transformations are canonical and are often useful for diagonalizing quadratic Hamiltonians (any quadratic polynomial can be put into the form of a sum of harmonic oscillators by a linear transformation of the fields).