Nothing is wrong (bar apparent (?) use of fixed form source continuation with Fortran 2003 code in 2013).
The first "destructor" call is to finalize the left hand side of the assignment statement.
The second call is to finalize the function result (conceptually after the value of that result has been used in the expression and transferred to the left hand side of the assignment).
Entities existing immediately prior to termination of the program (here by execution of the end program statement) are not finalized.