There is direction in space. Space is not a formless void there is order and structure to the universe.
The solar system is shaped like a disk. Most planets orbit and revolve to the same axis as the solar system.
When a star trek ship is seen in orbit, like the opening to TOS it is usually shown orbiting with the up of the ship facing the north of the planet, making a left turn with the planet off the port side.
Having a consistent orientation, like up=north would make sense for navigating a solar system. Federation ships in orbit are always shown rotating to face the direction of travel while in orbit. That's not at all needed to remain in orbit, but having consistent orientation seems important to the federation.
Is it actually? I always assumed orbits were all over the place and our 2d renders are similar to why paper maps are all fucky - just the easiest way to deal with 3d in 2d space.
The universe is not super precise, so it is a generalization, but within the solar system, planets orbit and revolve approximately in a plane.
The orbit of every planet in the solar system is within 8 degrees of the sun's equator. With the exception of Uranus, every planet's axial tilt is within 30 degrees of its orbital inclination.
The formation of solar systems results in most things settling into a mostly flat disk shape most of the time.
North is determined by the rotation of the planet. The sun sets in the west, and if you are facing west, north is to your right. This is true for any planet/moon and doesn’t have anything to do with magnets.
Venus and Neptune are the only round objects that are rotating in different directions in our solar systems. The angular momentum of the proto-planetary disc is preserved in all the bodies with enough mass to preserve said angular momentum following a collision. So every solar system has an inherently "up" and "down" to it's planetary disc with nearly all the major bodies in said system rotating in a similar fashion.
The ecliptic North Pole (Earth's plane of orbit) is a bit over 27 degrees off the plane of galactic rotation. Which one is "up" and why would a spacecraft that's done any number of inclination changes to get there care about it?
I think most space faring civilizations would orient themselves to the the local system they are in. Same way that maps of Manhattan are always rotated 29 degrees so the avenues are running up and down the page. Out in interstellar space i think a ship would orient to the galactic plane just for the ease of navigation. It's a lot easier for the navigator to plot a course if the ship is already oriented to their maps, e en if the computer does a lot automatically.
But I don't think mamy ships would spend much time hanging out in interstellar space. There is just way too much nothingness coupled with a shit ton of radiation since you are no longer being protected by local solar wind
Edit: this is all assuming FTL travel. I think the expanse probably does thing things closest to reality with the bulky skyscraper shaped ships that creat artificial gravity from acceleration. They don't have much in the way to really orient to anything since "up" is the direction of travel.
There's multiple things you're mixing up here. There's the "up" in the global coordinate reference frame. This could be based on the local system, though that makes entering and exiting the system a tiny bit more difficult. More likely it'd be based on galactic coordinates.
There's also the ship reference frame in the comic. This probably won't be oriented towards the global coordinate system. It'll be oriented towards whatever the engines, sensors, and gravity need. Because the ships will all be in orbit, their orientations will probably be changing constantly relative to other ships and the global reference frame. There's no reason to orient in a single direction and lots of reasons not to (it wastes energy, points your sensors away from the things you want to see, etc).