Basically, if you want to invade or attack and degrade an opponent, you are not doing it properly, if you have a huge army and no way to transport it to the target in any reasonable amount of time, if at all. You also are not doing it properly if you have no way to prevent the army from being destroyed in transit. You also are not doing it properly if you do not have the ability to first attack the landing site before actually putting your army on the ground.
If you have a huge amount of coastline to defend or an entire planet, and have no naval assets and no standoff weaponry that can be deployed from your location, then you are in serious trouble even if you can see the approaching invasion. The whole of your attacker's army is grouped up on individual vessels, and you cannot destroy it in those vessels until they are very close to your borders. If they get a foothold, they now have to face your land army, but also have the benefit of the terrain to use for cover from your own land army and supply lines coming via methods of transportation which you cannot attack while it is enroute to supply the army now on your land.
The Soviet Union had this problem, in a way. They had no way to counter attack the Germans in Western Europe or North Africa, because they had no navy and had little port access to that part of the world's oceans anyway. Recently, it is argued, this was the reason for the conflict in Crimea - some fools allegedly decided that they could tamper with Russian trade and military access to the Mediterranean, by manipulating policies regarding Russian port access at particular locations in Ukraine. With the reported "warming" of relations between Russia and Turkey, the former NATO threat from trying to sail through the straights of whatever at Istanbul is diminished. (It probably should have never been there, to begin with, but hindsight and current levels of education are drastically increased compared to Cold War decision making).
Basically, science fiction is using real-world examples of naval power when making imaginary space fleets.
This is all stuff I have read from historical accounts or supposedly authentic digital copies of declassified U.S. papers. The U.S. Navy continues to be as vulnerable as anything else to nuclear attack, among other things. Publicly, it got to the point where it was described as having the capability of simultaneously engaging and defeating every other navy on the planet. This, in implied fashion, indicates that you are not going to have much luck launching a naval assault on the Americas (or on anything else the U.S. Navy does not want you to attack).
It omits the fact that the U.S. Navy is entirely vulnerable to anti-ship missiles launched from aircraft or land installations. It is particularly vulnerable to swarm attacks from missiles carrying nuclear payloads or large conventional warheads. A science fiction example of this is the Death Star opening fire on Rebel cruisers (which were basically heavily armed aircraft carriers) in "Return of the Jedi". The only way to prevent the things from getting "nuked" was to pull alongside their Imperial counterparts so that any more Death Star participation would result in "friendly fire" incidents involving Imperial Star Destroyers.
I am trying to mix history/facts into this answer to state that it is likely that Science Fiction writers or movie directors probably get their inspiration, for many stories, from real-world examples.
A final thing to consider is that, like science fiction spaceships orbiting a planet, modern navies of some nations can attack anything located anywhere on the planet via ballistic missiles launched from submarines. The U.S. Trident II missile, if I remember correctly, can deliver several nuclear warheads per missile at ranges of something like 5,000 miles. The missiles can be launched from beneath the surface of the ocean. U.S. Tomahawk Cruise missiles, in their original design, were supposed to carry nuclear warheads and could be launched from the "new" B-1 bomber and B-2 Stealth Bomber. This was a serious problem, in terms of balance of power, because the B-1 was capable of very high airspeeds compared to other heavy bombers and the missiles themselves could not be intercepted when they were initially deployed. The missiles could also be set to literally "loiter" in the airspace of an opponent, until they were told what actual target to strike.
The U.S. ballistic missile arsenal is really a bunch of pilotless aircraft with particularly large effective attack ranges. It is described as being a different "thing" than the navy, but it really is not any different. Some of the missiles can launch from underground silos in the U.S. (if they haven't been secretly decommissioned haha), others can be launched from submarines. I do not believe that any nuclear variants of the Tomahawk missile remain in service, but I could be wrong. That missile could be launched from everything from submarines to surface vessels to aircraft, if I remember correctly, and had an effective range of over 1000 miles.
If you want to effectively fight anybody at any location in the space in which you are aware that there may be reason to fight, you want a large navy first and a large air force/missile fleet first. Even if you are only maintaining a defensive position, you do not want an approaching navy to get close before you can start attacking it to stop the invaders it is transporting.
Prior to the intercontinental ballistic missile, U.S. policy was that the best way to prevent an attack on the U.S. was to destroy it when it mobilized overseas (which probably explains why we were messing around in Korea and why we were quick to establish basing in as many locations near Soviet borders as the host nations would allow). This policy appears to have been the reason that we deployed nuclear missiles in Turkey, when those missiles still only had intermediate attack ranges, in the late 1950s or very beginning of the 1960s. They were already there when the Cuban Missile Crisis began (and may have been the actual reason that the crisis took place?)
Lastly, your invading army is not worth a damn if it doesn't have fuel, food, and ammunition. Neither is your defensive army. There has been a time when the U.S. economy was at the mercy of oil imports from places very near to Soviet borders. The U.S. nuclear arsenal also needed quality uranium, which is described as being in much greater abundance in places in the Eastern Hemisphere. Without a navy, the U.S. had no way to project influence on the decision making about those oil shipments or to maintain control of the situation that kept those shipments moving. Europe also relied on those shipments.
Science Fiction writers who are artistically representing warfare in space, and using real-world parallels, may be drawing from history classes or military experience or even government input on their work.