Why do Mail preferences get lost on reboot?
This is user level corruption or system level corruption in almost all cases. Sometimes it’s third party software, but that’s the hardest to trace, so focus on the easy steps first.

get a backup
Make a new user account and see if that user can maintain mail settings across reboots.

Based on that you’ll know if you need to address your user preferences, repair the disk, erase the disk and reinstall the os. After reinstalling, don’t set up the mac or restore the backup - just test the system with mail.
Then decide to wipe a second time and restore files / users or if you are better off setting up a clean system just transferring documents from the backup.