They’re treated as persons because they’re owned by persons, and it’s a lot easier to refer to the legal fiction than it is to invoke the legal rights of all the owners (whoever they may be). A programmer should recognize a useful form of encapsulation.
The abstraction breaks under some circumstances. For instance, they get no voting rights (as voting can’t be done collectively by a group).