If hidden accounts are discovered, this can, depending on the country, have various legal consequences such as a tax audit but also prosecution for fraud, etc...
As rightly said it depends on the country and the law governing legal marriage and also the agreement the both couple had before the law while the took oath to seal their marriage rights.
How does this work in your country, and what would you do with your coins in the event of a divorce?
First marriage in our today's society is transactional so I won't want to fall a victim of anything that will warrant losing my coin at the edge of divorce. But should in case I get blinded and forget my personal decision then I will have my coin saved in a hard wallet which will be kept where only me can access it and only my spouse turns out to be a good person will it become a family asset elsewhere I die with it.