Why did nature endow man with emotions? And why, with the evolutionary development of living beings, the range of emotions only increases?
Bc for example crocodiles and lizards can't form any kind of connection with their keepers at the zoo, however dogs can, not even speaking about humans themselves.
I'm no biologist, but I will try to answer this. The general answer, as with any trait, would be that it's either selected for in the species, meaning it helps an organism survive and reproduce, or it doesn't interfere enough for that to prevent the trait from being passed on. It's easy to see how certain emotions (like fear) are basically self-preservation mechanisms, ergo organisms benefit from having them to not die. Maybe a lot of emotions is just what instincts feel like for the animal itself.
My guess is a more complex nervous system is needed for an animal to be able to have more complex emotions, as with other sensations (eg a snail probably is unable to feel much besides something like signals for it to hide from danger). Another factor would be the necessity of social bonds to the organism's survival (most animals have some kind of protective instincts for their offspring, for example. pack animals form social bonds with members of their herd). As for connection with humans, it probably depends on whether the animal is domesticated (domesticated vs tame and feral vs wild are different). Dogs have lived with humans for thousands of years, and because of having a mutualistic relationship with humans, they form bonds with them. Whereas I would guess a lizard would not have the same thing because it is a wild animal that does not have this history of domestication to change its genetics to incline towards that type of connection with humans.