Data was found inactive on the surface of a planet that had been stripped of life. While we don't have the exact text of the Federation's version of Salvage Law, it is known from an episode of Deep Space Nine that abandoned technology on a lifeless planet can be claimed by its finder. This is consistent with maritime salvage laws.
It is unclear what, if any, inheritance law the Federation has. In a post-scarcity society, most people probably wouldn't have a significant estate to pass on to any heirs; it's possible this would be decided on a case by case basis.
The average citizen of the Federation likely has few true possessions as we imagine them. Any portable property you could own can be created with a replicator; energy is cheap and plentiful; we don't know what kind of data storage is available to the Federation (this was deliberate, to prevent it from becoming obsolete the day after they set a limit on it), but we can assume it's pretty big.
Most people probably do not own a home in any sense we would recognise. More likely they would live in apartments in arcologies or space stations. There's no money in the Federation, so there are no liquid assets to be disposed of.
Inheritance and its complexity take on a very different meaning when you take the idea of "value" out of the equation.
You're left with large and immobile assets, like houses or real estate, and unique items whose worth is in the meaning of the item rather than its physical composition - that is, its sentimental or historical value. These can be dealt with using a fairly simple inheritance law.
As far as we know, Dr. Soong had no biological children, siblings, or living parents; in such a situation, there's nobody else around to claim ownership of Data. There's no complex set of rules to trace back to the closest living relative, no value to be split between mothers and fathers sides of the family...there's just this unique android who appears to be sentient.
In such situations, it's not unheard of for unclaimed property to be either destroyed (if nobody wants it) or to revert to the state (if it's valuable). In this case, the latter possibility is a solid contender.
From two angles, then - Salvage Law and Inheritance Law - the Federation in general, and Starfleet in particular, could claim 'ownership' of Data if it was decided that he was, indeed, property.
Now that I think of it, of course, there are a couple of other ideas to bring to the table:
The law has long agreed that if a person finds a store of valuables (normally defined as gold or silver), and nobody else could prove they owned it, then it belonged to the finder. In the 20th Century, it was normal practice for the State to claim ownership of the actual property found, but to pay the finder for its full value. Of course, in the case of Data, it was the State itself that was the finder; so we have a third string to the legal argument. The fourth string would be the laws of Lost, mislaid and abandoned property.