I believe that fanfic writers are still entitled to copyright for the original parts of their work, and there is no legal issue if the work is sufficiently transformative, but I'd imagine many authors may prefer to have their fanfics avoid scrutiny in the courts in the event the work is found to not be transformative enough.