I don't ask this question, but there are places that do. Because it's not legal to ask if you're married or not, it tends to get asked in a very circular way, but often, what they're really asking is some variant on this:
How easy is it for you to move from city to city?
Not whether you're a stable family person, someone who can be paid less because you have two incomes or must be paid more because you have a family to support, or someone of good character. Just mobility.
Many places that are hiring doctors, professors, and executives, and expect those people to move to the new city will actually help to find a job for the spouse of the candidate they want. Truly. The more portable your spouse's job is, the happier they are. Other places may be less likely to make you an offer if your spouse could cause you to move to another city (your spouse has a high-flying geographically rare job) and more likely if your spouse can work anywhere (teacher, store clerk, office worker, chef.)
If you don't live in a place that forbids this question, or you do and it's asked anyway, I agree that you should clarify the question by finding out why they want to know. The best way to do that is to paraphrase. For example:
Are you wondering how easy it will be for me to move to your location for this job?
If they say yes, you could then reply "I can move immediately, you do not need to worry about the other members of my family at all" or "I have many ties to this city but I wouldn't have applied to your job unless I was willing to make the move to your location. Don't worry about my family members in that regard." These answers don't reveal anything about you but they answer the question.
If the job is in the place where you live, it's trickier, but
Are you wondering about my home support and my connections to [this city]?
If they say yes, you could then reply "I love living here and plan to do so indefinitely unless an amazing opportunity arises that would be worth leaving behind all I have here - friends, family, my home and so on."
If they say no when you ask "Are you wondering..." then they will probably clarify what they want. You can then decide whether you're ok answering that question or not.