How to add a PostgreSQL 10 identity column to an existing table with rows?
I cannot reproduce this with current Postgres 10.3. (This error should never occur.) Simple test:

dbfiddle here

I suspect you are running an outdated point release. Postgres 10.2 fixed some bugs that fit your case exactly. The manual:


  
  Fix assorted failures to apply the correct default value when
  inserting into an identity column (Michael Paquier, Peter Eisentraut)
  
  In several contexts, notably COPY and ALTER TABLE ADD COLUMN, the
  expected default value was not applied and instead a null value was inserted.
  


If so, an upgrade should fix your problem.
Consider the project policy:


  We always recommend that all users run the latest available minor release for whatever major version is in use.