Well, as humans we all want to be accepted. When someone doesn't and treats us awfully, the only thing we can think of is why? Sooo, we hang around them a lot out of desperation to understand why they don't enjoy us as others do. Can make you sad... but it's addictive. Yunno how dogs love the owner that disciplines them? We want to be taught well and appreciate the effort... But it often gets confused with being treated poorly. Wan wan wannnnn.
Probably because they feel like they cannot do better. It's ridiculous. Been there done that and had to learn the wrong way. I have abandonment issues though.