I go military heavy almost all the time and can easily get any victory I like on Immortal.
Sure. You can get any victory (though culture is more difficult, as noted) using military strength. However that isn't the same as suggesting that all victory conditions *benefit* from a military path. Neither science nor culture requires military action to succeed, and culture in particular doesn't much benefit from it.
One of the benefits of the military heavy route, is that you can stop the AIs from beating you to any particular victory.
To be honest, this is a problem with the Civ game engine - not Civ V, but the series generally. It doesn't provide very many options other than war that can act to stall or prevent opponents from claiming victory, so if they're that far ahead you pretty much have to wipe their capital/culture city etc. It works more effectively in Civ V than the earlier games because of the notoriously poor combat AI; in the older games the AI actually *could* defend its capital without a massive technology advantage.
The way to get round this is basically by teching faster yourself - which you are more easily able to do if you don't focus so heavily on military production/techs/policies. You can get through the tech tree faster by researching your 'core' tech path (in this case the Apollo Program) first, and then once you approach a point where you need techs from other paths to progress further, going back to research supporting technologies in other paths later, since that way you complete low tech research much more quickly. For instance, if you concentrate on teching to Education, by the time you get to that stage you can likely research Iron Working in one or two turns, rather than the 10 or so it would take if you researched it as soon as it becomes available. This also unlocks access to higher technologies that you can grab with a Great Scientist while you're taking your supporting techs, rather than either wasting the GS on a cheap technology or squandering rapid research by having him sitting around until you get higher tech access. However, this option isn't available with a military-heavy strategy that forces an early-game focus on techs that produce good units (no neglecting Gunpowder or Chivalry).
Also, in Civ V the other victory conditions are decoupled from things you can easily derail through conquest unless you wipe out a large portion of the civilization. Take the capital? Who cares, diplomatic victory doesn't care what your population is so it makes no difference unless it drastically reduces the AI's gold reserves. Culture victory doesn't care unless you hit a heavy culture-producing city at the right time to prevent them getting their final policies, or while they're in the midst of creating the Utopia Project and can't complete it in time anywhere else. By contrast it was much harder to destroy/capture a single cultural city in Civ IV, but it was all you needed to do to completely nullify an attempt at culture victory.
In any case, does the AI ever actually try to complete the spaceship even on Immortal or does it just create a couple of parts and stop?
Basically, military heavy (as well as being quite fun) means that you don't have to out-perform the AIs in culture or science (although you probably will) you just need to make sure to cripple them, so they can't out-perform you; then you can take your time. There's nothing like breaking Gandhi's legs to stop him racing you to the finish.
To be fair, military heavy is quite easy VS peaceful in Civ5. I have a lot harder time of it trying to win peacefully, than via war. Maybe I'm missing a trick?
You're missing the point rather than a trick, I think. It's notoriously much easier to win in Starcraft by rushing the opponent at 6-8 minutes than it is by playing a macro-heavy game with more complex strategy, and this is true even against human opponents rather than just against an AI that is particularly bad at the aspect of the game the military-heavy approach exploits. What's more, this stops working at higher levels in Starcraft only because you come up against opponents who can anticipate these rushes and adapt. In Civilization, you play against an AI that is never going to be able to adapt to this kind of 'rush' strategy. I wouldn't say that entails that Starcraft strategies *benefit* from rushing the opponent at 8 minutes; on the contrary more serious SC players tend to look down on it as a bad way to play that doesn't involve learning what the game actually offers strategically. Your approach doesn't benefit what you're doing, in the sense that it doesn't accelerate progress towards your science or cultural (and probably often not your diplomatic) victory condition, it just lets you win by playing badly since you can compensate for your empire's slow scientific or cultural growth by ensuring the opposing civs can't win the game first - as opposed to putting yourself in a position where the opposing civs couldn't win at all if they wanted to.
In my last game only one civ was eradicated and I was at peace with most of my major rivals for the larger part of the game, with the exception of Arabia - who became less and less of a threat as the war took such a toll on their finances that they couldn't support city state allegiance. By the end I was 11 techs ahead of my rivals, had alliances with every surviving city state, an unassailable capital, and none of my rivals were far enough advanced culturally to be a threat. I could have chosen one of three victory conditions to win the game without competition, without ever needing to smash anybody's spaceship or even go to war with any science-focused civ. I'd argue that simply being able to be that far ahead, reaching the modern era in the mid 19th Century and so forth, constitutes better play than letting my rivals get ahead of me in victory progress and then beating them up. Clearly my victory conditions, while they benefited from some warfare, didn't benefit from overmilitarisation - if I'd gone on a rampage I'd have suffered depressed growth, weaker science, less cultural development, and may not have had the spare gold reserves for all the research agreements and city-state alliances that kept me ahead (since I'd have to fund courthouses and happiness buildings in conquered cities).