It looks like the placement of node creating code is wrong. Say for example, if we add any code in a form definition, it might get called more than once when we try to render the form using drupal_get_form().
To solve this problem, just add a debug statement (drupal_set_message) above node creation code and see how many times control comes there. if it is more than once, then our assumption is correct and probably you want to move your code to somewhere after all these processing done (and executed once). Worst case, you can check for the presence of nid and discard the insert.