To answer your question. If I were to ask you that, which I would do with a lot more tact (such as, "do you have a dog? I love dogs. Oh, you don't! So you must be a cat family or a family that backpacks the Rockies"). Asking you if you live alone is only asking you indirectly if you are single. Just, a lot of men don't think about the dangers there are of being female, so they ask quite audacious questions. The root of the question is attraction. For some reason, you caught his attention. His attention could have been caught by your house being immaculate, by you having or not having a ring on your wedding finger, and a plethora of other reasons. Maybe he liked your car. Maybe he seen you have an Xbox, if you have a son or whatnot.
If I, as an introvert, so as much say "hi" to you in public, I am attracted to you. If I open my handsome mouth, there's a definite reason. I say, "nice house" if I am visiting a house. I say "thank you" when someone helps me or to the cashier. I say "excuse me" when I am in someone's way. And I say "hi" to absolutely no one, unless I like you OR (of course) I see business potential.
I don't see a guy asking you if you live alone for any bad reason (unless you hire thieves to work on your house), because you could sleep with a shotgun next to you (which I hope you do... as former Military Police), you could have an alarm system, you could have a Mastiff, he just doesn't want to end up in jail, or like my female acquaintance you have a defense sprinkler system.