Its a dangerous question to ask anyway, not because its against the law, but because it is somewhat ethically grey - the candidate would feel they've been discriminated if they had answered that question "poorly".
> There is no federal law about Marital status discrimination, only state law, and not all states.
Asking a woman if she's married could lead to being accused of sex discrimination -- "she's married, and she's a woman, so she'll want to quit to start a family" [or, "she'll have extra home responsibilities because we all know women do the bulk of the work at home"]. I'm not saying that would be a sure-fire claim, just that it could open the door to that accusation.
https://en.wikipedia.org/wiki/Employment_discrimination_law_...
Note that California does prohibit it, but it seems to be a recent law.
This http://www.unmarriedamerica.org/column-one/01-08-07-californ... implies it was around 2007/2008.