Well the writers specifically point out in Into Darkness that Scotty "thought we were explorers"
The writers also specifically point out in Star Trek Eleven, through Christopher Pike, that the Federation is " a peacekeeping and humanitarian armada." No mention of exploration there.
Anyway that a alternate universe.
Voyager's mission wasn't to explore yet they do it for the entire seven seasons.
Even there Voyager's primary mission was "returning to port," secondary was searching for resources and supplies. Down towards the bottom of the list was exploring, it wasn't job one.
"Starfleet is not a military organization, its purpose is exploration."
- Jean-Luc Picard, Peak Performance
That was in the episode where Picard's superiors in Starfleet hierarchy ordered Picard to participate in war games.
Exploring is definitely the top of their list. Combat is at the absolute very bottom.
Look at it this was, what comes first? That's the primary mission, that's job one.
If you look at the American military, what do they spend most of their time doing, combat? No, it training, but that training stops when it comes time to break things and hurt people. Starfleet engages in exploration when there noting else more important going on, exploration isn't even number two on the list either, other things come before it.
You see nothing? Have you ever even watched Star Trek?
Of course, this is where Starfleet is the Federation's military comes from.
The crews general attitude towards the 20th century seems rather dismissive in that episode.
Picard was derisive toward them before they even woke up for the first time.
Well, keeping in mind they're in a world where we wrecked our planet in WWIII
Given the we were able to completely recover from that war in only a few decades, "wrecked" is likely overstating what happened.