I think that Gödel did all of this stuff because of David Hilbert basically posing the challenge to make maths' foundations consistent and complete.
Hilbert's idea was that by completely formalizing mathematics on a axiomatic/deductive basis, one can mechanically derive proofs so that you don't run into paradoxes/contradictions.
But then Godel showed such a formal system applied to basic mathematics can never be complete (if consistent) and never prove its own consistency.