^ To be fair, there's no indication that any of those "mining EMH" programs were sentient.
The final scene, showing two of them discussing
Photons Be Free, pretty strongly indicates sapience. But the thing is, I don't see why we should think that this scene was real, not with so much of the episode being Doctor-written, meticuously visualized fiction.
By allowing him to join, not to mention promoting him and giving him medals, they explicitly gave their consent for him to resign, the same as any other officer could. There is no ambiguity there.
Quite so - but the point seems to be that evidence was later uncovered to nullify these earlier actions; to wit, Data was found to have been Starfleet property at the time, and thus ineligible to the above things, and the consent was misguided and inapplicable. Had this fateful ruling been upheld, even a verdict of Data having the right to refuse Maddox' procedure would have left the android high and dry...
Furthermore, for Maddox to have opposed Data's entry, then claim he cannot resign, is a contradictory stance that clearly shows his bias; this bias should have been addressed far more than it was.
A more protracted proceeding would no doubt have addressed this. However, Maddox didn't really put weight on the argument "can't resign" - that was just a brief and unfortunate wording of the general sentiment "must obey", which Maddox very consistently pursued. Since the court was already in favor of the "is property" interpretation, it would have been rather fruitless to attack the case from the Maddox angle as that would have meant attacking Louvois as well.
Lastly, the implication of ruling against Data is that Starfleet considered him their property from the moment he was activated.
How so? Louvois never expressed such a finding or interpretation.
The points expressed were these:
1) Maddox considered Data an officer who had to obey orders, including having to submit to his experiments.
2) When Data threatened to resign, Maddox switched to considering Data a machine, in the hopes of having him declared property and thus forced to undergo the experiments.
3) Louvois did not address the issue of machine-or-not but found Data to be property according to precedent.
4) Riker demonstrated that Data indeed was a machine, which in his opinion would support the Maddox/Louvois viewpoint (although this was just his interpretation, not really confirmed).
5) Picard insisted that Data was sentient, from which it apparently would follow that he would be "entitled to all the rights reserved for all lifeforms" in the UFP - a curious wording that may mean Data would enjoy the same rights as a cat or a daffodil, which would hardly protect him from Maddox' experimentation.
6) Goaded by Guinan, Picard then insisted that unless the court decided in favor of Data's self-determination rights (despite the incomplete evidence), it would fail to err on the side of caution, so to speak, and slavery would be the ultimate result.
7) At this point, Louvois defused the situation by refusing to address any of the big issues. She agreed that Data was a machine, but assigned no relevance to the fact. She withdrew the ruling that Data was property. And she affirmed Data's freedom to choose (although we never learned what the minutiae would ultimately read, and whether Data now enjoys the freedom to choose anything and everything or just whether to undergo Maddox' procedures).
Timo Saloniemi