Those of you who have read The Infinity Gauntlet, the comic book source material Infinity War is inspired by, know that there was a lot of action that took place in outer space, so naturally the MCU would want to follow a similar path with its tale of Thanos fighting most of the Marvel superheroes.
When the MCU began in 2008, it was a universe grounded on solely on weird stuff happening around Earth, but Thor paved the way for extraterrestrial life via the Nine Realms.
Guardians of the Galaxy was later set almost entirely out in other areas of the galaxy, while Ant-Man and Doctor Strange threw alternate dimensions into the mix.