The actual deployment only creates / updates resources. It does not delete resources.
That is why the delete deployment section is in the script. This section iterates through the extant resources, looking for those whose name does not exist in the deployment template. These it deletes.
If you would like to disable this feature, call the script with -deleteDeployment $false
.
The fact that everything is being deleted, suggests the script was unable to read the resources. This could happen if the wrong file was passed to the script.
I tried running the script without passing any arguments. I saw that it continued to try to execute even when it was unable to read the (missing) arm template file. I will suggest a change to the developer on how to make it safer.