But dangerous dogs who attack strangers don’t ask questions. If they’ll bite a strange thief, they’ll bite other strangers without bad motives. Dogs are smart, but they don’t understand “Hi I’m your new mailman”, etc.
That was just one example of many plausible scenarios. There are dozens of scenarios where dogs and people may be on different sides of said fence. The issue is an indiscriminate danger to people. It's the same reason you can't booby trap your own property.