Not by way of attempted apology, but just to try to answer the question:
Many men are not aware, or not very aware at all times, of the context some women have that @KNOWITALL just described as “we have to be very careful about meeting up with people we don’t know” and the idea that there’s a notable risk of being attacked and killed, especially in the context of simple transactions or going for a walk or something. Many men do not think that way about situations themselves unless it’s a ghetto or skinhead or Trump rally or something, and aren’t very aware that women may feel they have to constantly worry about that.
And many men do not have a “that’s weird, so therefore I should cease all contact with this person” logic going on.
And since few guys would tend to have that reaction if a woman or (unless a homophobe) a gay man or anyone asked them if they were married, they may tend not to think they’re going to come across as creepy or threatening if they ask a woman that.
It seems to me that many men are often likely to approach social situations from a frame of mind of “I know I mean well, so that should be good enough” rather than trying to think from other people’s social perspectives about their own behavior.
And IIRC, many men have “are you single?” in their vocabulary of things that are supposed to be ok to say to women, and that may even lead to positive responses.