To begin, it looks like you might not have the latest version. Since I have some options that you don't (from your screenshot).
See here: https://screenshots.daviddennison.com/hM2gVWL5
I believe to solve your problem you need to head over to your profile and go to the session tab. You'll see options at the top to adjust closing behavior.
See this screenshot:
https://screenshots.daviddennison.com/Y76Xnq9X
If that doesn't work, you may need to uninstall iTerm and re-install it. I had an issue where iTerm would crash whenever the sudosudo
password was needed. It would then open other iTerm windows ANDand the terminal and get stuck in a loop until I force quit both of them. So I think sometimes the shell integration gets funky and out of whack.