We all get the feeling we could have done better when we've created something. It's part of the human psyche to be self-critical when others barely notice flaws.
Creative writing is just that, creative. We can write factually, convince ourselves and others of the validity of our arguments, description, analysis or whatever. If we write creatively we're in charge of what we put down, and that's when the self-critical part of our brain kicks in.
Can we convince ourselves that what we've written is our best effort? Or maybe we could do better, as if we were 'in class' as Tim Mitchell points out we instinctively regress to the school room when we're meant to look outward. We've got to forget the constraints of writing essays to gain marks out of 10 or 100 or whatever.
What teacher told us no longer applies in creative writing. We're writing for an audience, to entertain - maybe inform - and put an image into the reader's mind of what we've created. The best instances of that are in horror or science fiction, where the writer either brings an alien environment out of the everyday, or conjures up something for the reader they've never before encountered, like 'The Pit And The.Pendulum', 'Frankenstein's Monster' or 'The Time Machine'. If the writers had stuck to the classroom principle their writing would have been boring. As they'd introduced a new concept to the reader, the eye kept going and the mind followed. That's the job the creative writer is 'charged' with, to bring the reader's mind into their world..