From man 1 tmux:
destroy-unattached [off | on | keep-last | keep-group]If
on, destroy the session after the last client has detached. Ifoff(the default), leave the session orphaned. […]
tmux set-option destroy-unattached on will set the option to on for the current session. If you want tmux always to behave like this, set the global option in your .tmux.conf:
set-option -g destroy-unattached onand restart your tmux server.