Earlier quoted context omitted.
I can't think of any other situation when one person getting a job puts legal obligations on their spouse, but I haven't looked into it.
Your spouse can definitely affect your ability to get a security clearance. Last I heard, cannabis use is still relevant to this, even if you live in a state where it's legal. Your spouse being a foreign national can also be significant, depending on which country and their connections there. It's not really a legal obligation as such ("only" putting the job at risk), but it does cover rather a lot of jobs.
The process of doing away with this entirely started last year: https://www.wsj.com/articles/u-s-spy-agencies-could-hire-for...