In films and shows you do not hear sound from the camera's point of view, but from inside the ships that are shown
When you see action in space in films you do not necessarily imagine yourself as an actual bystander (i.e. byfloater in space), because that just would not make much sense. Why would you as the supposed audience get your ass in a space suit and fly into open space and on top of that in a tense situation with laser (or phasers), explosions and flying ships (because these are the situations when there is much noise in the films), so why would you as the audience float there? It makes no sense anyway.
What I am always imagining is that in outer space shots we only see what the camera films, and we hear what microphones pick up, but these microphones do not need to be in space. If you see an explosion on a spaceship that is hit by an energy beam, why not you just imagine that the sound of the beam and explosion is the sound you hear on the ship. Because clearly the focus is on the ship where the explosion is. And since these ships most often have an atmosphere inside to support biological life, of course you would hear the explosion inside the ship.
This theory however does not work if we hear sounds from multiple instances which are not connected. OK, then you cannot imagine that the sound comes from the one supposed place the film team's microphone is operated. Probably they had multiple microphones and later edited the sounds together? I know, from that point on it gets confusing. But in most instances you have only one or two sources of sound and then I can imagine that the microphone is placed there.
That is actually not all that unusual. You know, in an Earth-based film, in a scene in a crowded place you most often prominently hear what the characters in the film's focus say. When there are hundreds of people walking the city streets and probably half of them are talking, but you in the foreground you hear two people talk, then these people who are a bit easier to understand are obviously the characters that are important to the film's plot. So obviously, the microphone dude wants to pick up exclusively what these people have to say and in the same way in a space battle you hear what happens in the place of importance. The film team has not put up their microphones in empty space, because there is nothing important there. Hence, they have put up their microphones on the ship. On the ship there is air and the air carries the sound you hear in the film.