I do the same things (except for addressing strangers...just not a habit of mine). I may be dead wrong but I associate the "yes ma'am" and "yes sir" to be related to my Southern upbringing.
P.S. I'm finding it harder and harder to find people older than I to open doors for.
I do it because I grew up in a military family. Now that I'm well on in middle age, if the other person is clearly quite a bit younger than I am, I might say "Son" or "Hon."