When you exit the project, the file is deleted -- but only if that file was recorded/created in the same session you have deleted it.
The rationale for keeping it until the end of the session is to let you undo. Going beyond the session that created the file, there is another rationale: you might have made a copy (or copies) of the project since you first created it, and if Sonar deletes the file on behalf of one copy of the project, that would ruin other copies. There is no decent way for Sonar to track the usage of recorded files, but there is the
cwaf tool for scanning through all your projects and all your audio files to find files that can be deleted (orphans).