That is one option, but the spouse has to have some idea of what to do next or have some kind of help e.g. from a trusted fellow domainer. It can also be risky, and I've seen some divorce struggles over domains that inevitably get nasty when two parties have the access to one account.
With gTLD domains it can get pretty messy to handle everything, with loads of different registrars and all. As long as you're an active domainer, you will inevitably have the domains scattered all around depending on where you bought/snapped them. If you throw in some exotic ccTLDs into equation, it becomes a Gordian Knot.
My main market is .pl and there I'm keeping everything tidy. Transfers are free and transfer lock is only 5 days from registration or last transfer, so I keep all the domains at one registrar, but sorted into four accounts: one for top domains (instructions for the heirs: keep renewing them until you get a very good offer), one for LLL (this one kinds runs itself, just keep selling/leasing, renewing and withdrawing the surplus money), one for private domains (important for me for various reasons: mailbox, website, or just collectibles) and one for everything else (just auction everything off with no reserve). These instructions + access details are in a sealed envelope in my drawer (though I probably should take it to a notary for safekeeping and quicker access), plus I have two trusted domain-people who promised to help handle everything if need be.