Allowing a pet to jump all over someone and hump their leg is really not treating the pet like a human since humans don’t do those things.
If that’s the scenario upon which your Q is based, a better Q might be “Why do SOME people spoil their pets ?”
Most of the time it’s because they’re too clueless or too lazy to exert themselves to properly train their pets.
And saying anything to the animal or yelling at it does no good at all since you’re only an occasional influence upon it.
It’s the people to whom you need to assert yourself and bluntly let them know how rude it is to allow their animal to act this way toward their company.
The owner is the problem. The pet takes it’s cues from them.