Your body language is calling your dog to you. You are walking in a way that urges your dog to come to you, to follow you. You are not walking away with confidence. If you are unsure, your dog will be unsure and an unsure dog will want to be near you. If you don't expect your dog to stay, he will follow you.
Animals read peoples body language, their scents, their thoughts, etc.
The tiny differences in the way they say and do things is a whole language in itself. People don't realize it but they give off different scents as their attitudes change and before their actions come into play. Animals can smell your intentions long before you do them. This makes some people afraid of animals because if they are fearful of an animal, the animal can smell this and reacts long before the person even gets close. The smell of is very close to the smell a person gives off if they are aggressive or antagonizing.