The whole thing with the Doctor's "program" being copied broke the established logic that the franchise was working with and I hate it for that reason. I hate the existence of B4 and that he was supposed to be a "replacement" for Data despite doing nothing to earn it, even more. It's like they're afraid of character death and so come up with contrived situations to avoid it, but then think "oh shit wait" when they realize they remove all narrative tension when they make a character functionally immortal. What reason do we ever have to worry about the Doctor being in harm's way if they could have just stored another copy of his program somewhere in Voyager's computers? What reason would we have to be concerned about Data if Soong can just shit out another android and it'd be "almost exactly the same".
Starfleet, by and large, seems to be an expert at throwing the proverbial spaghetti at the wall and seeing what sticks, and not changing anything unless they have to. I'm sure the question over Data's sentience came up a time or two, but because he functioned in the capacity granted him, so they just shrugged it off and kicked the can down the road. Maybe, before then, there just had never been someone who ever proposed taking him apart and trying to make more. Or they just figured that machine intelligence in command positions was a natural evolution of technology, and it would free up the living humans to do science and art and other such Federation shit. After all, there is PROBABLY a precedent where the Enterprise computer can take command and warp the ship out of danger if everyone on board is incapacitated because of exposure to antithorium gas radiation from a reverse-folded dogcum nebula.
It also depends how you see command authority on a starship aka a Navy. Is everyone on board below the Captain's rank just a tool to be used at his discretion? Because if so, whether that tool is a person or a machine intelligence doesn't make much of a difference. Picard "trusts" Data to be third in command, but he also "trusts" the replicator to serve him tea, Earl Grey, hot and not cyanide, and he "trusts" the warp core to not have a programming malfunction that causes it to instantly breach. The idea that people could think Data is a soulless machine despite being capable at his JOB isn't really a stretch if we assume these are people who still believe in magical, immeasurable, undefined things such as souls. The judge lady even said something to that effect in the episode.
>Are there a lot of starfleet officers that aren't considered intelligent enough to be sentient running around somewhere?
No reason why not. I'm sure they could find some kind of menial task for them to do so they can contribute, even if that's just sweeping the floors.