The father was hallucinating or daydreaming that the doll was alive. In his grief and agony from illness and families death, he "created" a scenario in which the doll was a real life girl that had been his daughters best friend. He further envisioned that because of this girl he would no longer be lonely and that the girl would offer him a reprieve with a quick and imminent death.

So, it was the doll after all..