How to add an external image to node with a module?
File field references are made on the fid column in the file_managed table -  you haven't saved the file object so it doesn't have a fid, and thus nothing to relate the field data to.

Just add a call to file_save after you've prepared the file object, but before you add it to the field on the node object:

file_save($file);