It's an interesting sequence of events leading to the hearing:
1) Louvois tells Picard that Data can refuse to participate in the procedure, but can't refuse to be transferred to Maddox's command without resigning from Starfleet. Which makes sense as far as that goes.
2) Picard expresses concern that once Data is transferred Maddox might apparently coerce him into being subjected to the procedure. It's nice that Picard has such faith in a fellow Starfleet officer.
3) Data submits his resignation.
4) After Maddox protests, Louvois initially finds based on 21st century legislation, the Acts of Cumberland, that Data is considered Starfleet property by virtue of being a machine, and consequently can't resign. Unfortunately we aren't given much detail regarding the legislation in question.
5) Hearing.
It is unclear (and probably unrealistic) as to why matters are so rushed, nor do we know enough about the Acts of Cumberland to make any arguments regarding them one way or another, or even ask why legislation from the 21st century is being used as a precdent in the 24th century.
I think ultimately you just have to kind of go with it as setting the stage for a discussion as to whether or not Data will be considered to legally have the right to self-determination.
As to the fact that Data joined Starfleet of his own volition, it is stated in the episode that Maddox didn't feel he should have been able to do so. It's surely a point of irony that Data being allowed to join Starfleet was what later set the stage for him being considered potential property...but I'm not sure it's that different from serving in contemporary armed forces, where individuals who do so may willingly surrender certain rights. I'm less clear on whether anyone in the military ever found themselves in Data's position of being asked to submit to a dangerous procedure and had to fight for the ability to refuse it.
1) Louvois tells Picard that Data can refuse to participate in the procedure, but can't refuse to be transferred to Maddox's command without resigning from Starfleet. Which makes sense as far as that goes.
2) Picard expresses concern that once Data is transferred Maddox might apparently coerce him into being subjected to the procedure. It's nice that Picard has such faith in a fellow Starfleet officer.

3) Data submits his resignation.
4) After Maddox protests, Louvois initially finds based on 21st century legislation, the Acts of Cumberland, that Data is considered Starfleet property by virtue of being a machine, and consequently can't resign. Unfortunately we aren't given much detail regarding the legislation in question.
5) Hearing.
It is unclear (and probably unrealistic) as to why matters are so rushed, nor do we know enough about the Acts of Cumberland to make any arguments regarding them one way or another, or even ask why legislation from the 21st century is being used as a precdent in the 24th century.
I think ultimately you just have to kind of go with it as setting the stage for a discussion as to whether or not Data will be considered to legally have the right to self-determination.
As to the fact that Data joined Starfleet of his own volition, it is stated in the episode that Maddox didn't feel he should have been able to do so. It's surely a point of irony that Data being allowed to join Starfleet was what later set the stage for him being considered potential property...but I'm not sure it's that different from serving in contemporary armed forces, where individuals who do so may willingly surrender certain rights. I'm less clear on whether anyone in the military ever found themselves in Data's position of being asked to submit to a dangerous procedure and had to fight for the ability to refuse it.