On a personal level, an unexpected interaction can lead to meeting friendly people. You may even get some unexpected "reward" out of it: say maybe a neighbor was knocking to see if they could borrow your car, maybe the same neighbor has some plumbing skills and notices the leak in your kitchen, and proposes to fix it for you.
On a societal level, unmediated interaction between strangers is very important for social life and a sense of community. Please note there is a huge difference between unsollicited contact and stalking behavior: a person knocking on your door to ask something is certainly not in the same mindset than someone following you home.
So sure there's scams and salespeople. But if you don't open the door to those, you'll miss plenty of friendly interactions as well. At this point, better not check your email or phone because there might be spam there too?