It’s not that there wasn’t any benefit to pet ownership before but that the purely positive undertones occurred much later. More often than not in history, it’s generally ambivalent. There was value in pet ownership but not when it’s met with suspicion whether on the basis of witchcraft or a form of social ineptitude and selfishness (in the sense of caring more for them than for people) that a purely sentimental attitude would arrive much later. The suspicions still exist to this day, even among well-meaning people.
What should be remembered’s that we’ve come a long way when it comes to understanding the benefits of pet ownership in the context of the hierarchy of needs. However in the case of commensal domesticates like cats and dogs, these are inevitably met with some amount of uncertainty on the basis of liminal pestilence. They’re useful for hunting vermin but they can become vermin themselves. Not to mention that even having dogs purely for companionship, though beneficial, was met with distrust.
Even today. It’s not wrong to have them as pets but that historically even having a pet dog (and especially if it’s either a toy dog or a poodle) purely as a companion’s met with suspicion, whether as a marker of spinsterhood, witchcraft or bestiality.