Recall that Gödel's First Incompleteness Theorem (denote GIT1) states, roughly, any axiomatic system $S$ stronger than Peano Arithmetic (PA) cannot be "covered" by finitely many axioms. GIT2 states, roughly, that furthermore such $S$ cannot prove, within itself, its own consistency (denote $\mathrm{cons}\; S$). And it is often said that GIT1, together with GIT2, invalidates Hilbert's program (HP).
It's rather obvious to me that GIT1 declares HP to be problematic, if not impossible. But what GIT2 says of HP, is less obvious. Indeed, even if $\mathrm{cons}\; S$ were a theorem within S, that is
$$\models_S \mathrm{cons}\; S$$
and suppose we do not know GIT2. Then, it is possible that $S$ is inconsistent, and a contradiction formula is a theorem in $S$, which in turn entails $\mathrm{cons}\; S$. Thus, it seems, whether $\mathrm{cons}\; S$ is a theorem or not, is not very important. If so, GIT2 does not really tell us much by saying that $\mathrm{cons}\; S$ is not a theorem in $S$.
So how was GIT2 a bad news to Hilbert's view?