This was a fun film. I thought the ending was sad but kind of heartwarming at the same time - Robot is taken away and has its memory wiped, but Frank's family is reconciled. :)
...that isn't how sociopathy works. And, strictly speaking, it does
have a moral code - it's programming is focused on promoting its owner's mental health and ability to function with minimal assistance. Asking it to run ethical analyses centered around the interactions of large groups is probably an unnecessary feature most of the time (how many assisted-living patients function best in illegal circumstances?) and would probably be considered unnecessarily expensive for the low benefit offered.