Why F-theory picks Calabi-Yau manifolds as backgrounds?
One of the points of F-theory is that it may be imagined to be a 12-dimensional theory – however one in which two dimensions are compactified on a tiny, infinitesimal two-torus.
But the supersymmetry generators are exactly those that are fully compactible with the 12-dimensional interpretation – after all, all "type IIB supercharges" in F-theory transform as a chiral spinor in 12 dimensions. So the logic of the proof that the background is Calabi-Yau is really the same.
The "Calabi-Yau 4-folds" of F-theory don't really have all the moduli because the two directions among the 12 are infinitesimal. But one may show that the complex structure may be defined just like for generic Calabi-Yaus.
Alternatively, you may just construct an analogous proof directly for F-theory. But the essence will be analogous. The holonomy group has to be restricted analogously.
The answer given by @LubošMotl is far from satisfactory. In particular, the sentence:
"The "Calabi-Yau 4-folds" of F-theory don't really have all the moduli because the two directions among the 12 are infinitesimal."
does not make sense.
One way of seeing in precise terms that F-theory must be compactified on a CY four-fold is using the fact that a F-theory compactification to $N=1$ four-dimensional Minkowski space-time can be defined in terms of a M-theory compactification to $N=2$ three-dimensional Minkowski space-time. If you accept this procedure then you can use M-theory to characterize the compactification manifolds of F-theory. $N=2$ Minkowski compactifications of M-theory were characterized here:
https://arxiv.org/abs/hep-th/9605053
using its low-energy approximation, eleven-dimensional supergravity, appropriately corrected with a M-theory correction. This correction is necessary in order to avoid the Maldacena-Nunez no-go theorem. The result of the paper cited above is that the compactification manifold needs to be a CY four-fold. This is obtained mainly by studying the Killing spinor equation associated to the gravitino supersymmetry transformation, which under the assumptions made on the paper requires the existence of a pair of independent real spinors of the same chirality on the compactification manifold and satisfying a particular first order PDE. Manipulating this equation one can show that it induces a $SU(4)$ structure globally conformal to a CY structure and hence the compactification manifold is CY. However, the physical metric is not CY but conformal to a CY metric.