All the answers name some valid points, but they fail to really answer the question which I want to repeat for clarity:
Why is 50 Ω often chosen as the input impedance of antennas, whereas the free space impedance is 377 Ω?
The Short & Simple Answer
These two impedances have no relation at all. They describe different physical phenomena: the antenna input impedance is not related to the 377 Ω free-space impedance.
It is only by accident that the unit of both terms is the same (i,e., Ohms).
Furthermore, 50 Ω is just a common value for characteristic impedances of transmission lines etc., see the other answers.
Basically, the input impedance of an antenna, any other resistance or reactance, and characteristic impedances are circuit-level descriptions for handling voltages and currents, while the free space wave impedance is for describing electric and magnetic fields. In particular, the (real-valued) 50 Ω input impedance means if you apply 50 V of voltage at the antenna feed, 1 A current will flow trough the antenna feed point.
The free-space impedance has no relation to any antenna or material configuration. It describes the ratio of electric and magnetic fields in a propagating plane wave, which is approximatly obtained in an infinite distance to a radiating antenna.
The Longer Answer
The first impedance mentioned in the question is the input impedance of the antenna, which is a sum of radiation resistance, loss resistance and reactive components which are described as the imaginary part. It is related to currents \$I\$ and voltages \$V\$ at the feeding pont on a circuit-description level, i.e.,
$$R = \frac{V}{I}\,.$$
Changing the feeding point of the antenna, the value of this radiation resistance might change (this fact is employed e.g. for the matching of inset fed microstrip patch antennas). The radiated fields, however, stay basically the same.
This impedance \$R\$ of the radiation resistance is the same kind as of a resistor or the transmission line characteristic impedance of coaxial lines or microstrip lines, since these are also defined via voltages and currents.
The radiation resistance is not a real resistance, it is just a model for the radiation case (i.e., operating the antenna to transmit power), where power gets lost from the circuit point of view since it is radiated away. (On a related note: using this resistance for the receive case is misleading, since there occurs no loss in the radation resistance. It is still important for matching, though.)
The second impedance is a wave impedance of the fields, which describes the ratios of electric (\$E\$) and magnetic (\$H\$) fields. The free-space impedance, for instance is given as
$$ Z_{0,\mathrm{free\,space}} = \frac{E}{H} = \pi 119,9169832\,\Omega\approx377\,\Omega\,.$$
(This exact value was used before 2019, see Wikipedia on the free-space impedance)
We can immediately see that fields and voltages have a relation that might change with geometry etc, or there might be no unique definition of voltages (e.g., in a hollow waveguide).
To make this lack of relation of these kinds of impedances more clear, an example might help.
In the very simple case of the TEM wave inside of a coaxial cable, we know how to calculate the characteristic impedance the coaxial cable based on the geometry as
$$Z_{0,\mathrm{coax}}=\frac{1}{2\pi}\sqrt{\frac{\mu_0}{\epsilon_0}}\ln\frac{r_{\mathrm{outer}}}{r_{\mathrm{inner}}}\,,$$
if we assume that the filling material is vacuum.
This is a characteristic impedance (of the transmission line) for the currents and voltages of this line, and this is the kind of impedance which should be matched to the input impedance of an antenna.
However, having a look at the fields inside the cable, we find that the electric field has only the radial component (exact values are irrelevant in this context)
$$E_r \propto \frac{1}{r \ln(r_{\mathrm{inner}}/r_{\mathrm{outer}})} \,.$$
More interestingly, the \$B\$ field has only a \$\phi\$-component which is a scaled version of the electric radial field
$$B_\phi = \frac{k}{\omega}E_r=\frac{1}{c}E_r\,,$$
where \$c\$ is the speed of light, which is from free space (!) because the medium inside is free space.
By using
$$ B = \mu H\,,$$
we finally know the phi-component of the magnetic field as
$$H_\phi =\frac{\sqrt{\epsilon}}{\sqrt{\mu}}E_r=Z_{0,\mathrm{free\,space}}E_r\,,$$
Therefore, the ratio of electric and magnetic fields is constant and only medium dependent; however, it does not depend on the geometry of the cable.
For free space inside the coaxial cable, the wave impedance is always approximately 377 Ω, while the characteristic impedance is geometry-dependent and can take any possible value from almost zero to extremely large values.
If we look again at the example of the coaxial cable and leave it open at the end, achieving a characteristic impedance of ~377 Ω does not relate to anything about the fields. Any coaxial cable filled with air has a wave impedance of ~377 Ω, but this does not at all help to make the open piece of coaxial cable a good antenna. Therefore, a good definition of antenna does not relate at all to impedances, but reads
An antenna is a transducer from a guided wave to an unguided wave.