and if he wasn't a person, he was the property of Wanda and/or Tony Stark, and Heyward was stealing her property by holding it and vandalizing it by dismantling it. Either way, Crimey Heyward's going to jail.
So, this is a line of thinking I know they won't be using, but it might be entertaining.
The Jarvis AI (which is Stark technology), and the Mind Stone are used to produce the Ultron AI, by Stark and Banner. Stark's legal claim on the Mind Stone is... highly questionable. It is a natural resource, but recovered from Loki when he used it as a weapon. Loki and the Mind Stone were in custody of SHIELD - a government agency. But that was custody as evidence, and does not indicate ownership. Let us leave ownership of the Mind Stone and its internal logic out of the discussion for the moment...
And now we hit an interesting hitch. Was Ultron a person? If not, then Stark Industries is on the hook for all the damage Ultron does, as their technology run amok. That includes illegal acquisition of Vibranium, the death toll and property damage in Sokovia, goodness knows how many acts of cybercrime, etc. Stark Industries was big and wealthy, but not that wealthy. This should have destroyed Stark.
But, it didn't. So either Ultron's origins were hidden from the world, and the whole thing covered up, or a legal out was found. Calling Ultron a person makes his actions purely his (I think they use the masculine pronoun in the movie) own, and gets stark largely off the hook.
If Ultron was a person, then Vision, as Ultron's progeny, was also a person. Then Heyward was defiling a corpse, which is generally illegal.
If Ultron's origins were hidden from the world (which may not have been all that difficult, as so few people actually
knew those origins), then it is very difficult for Stark to make a claim to legal ownership of Vision.
Vision's body was created from stolen Vibranium, the U-GIN regeneration chamber, and arguably Thor, who all then have potential claims on Vision's body. The head of U-GIN died,however, so it may be they do not know what happened. When all was said and done, Thor was probably not in any state of mind to exert his claim (which is kinda weak, but... he is a god, who would be able to stop him). Wakanda, for whatever reason, did not take custody (possibly, nobody there actually
thought about it).
But, lastly, Vision worked with the Avengers, which was a government funded project. I suspect that once he is dead and unable to argue otherwise, it is easy to make the legal argument that Vision was an Avenger's Project asset, which was then transferred to SWORD. This would mean that Heyward's work with the body wasn't exactly illegal (on basis of ownership) though it may have been unseemly or unsanctioned.
Heyward's arrest, then, is probably more about his tactics - his evidence tampering, questionably holding a federal officer and civilian (Woo and Darcy), use of force within a civilian population, and so on.