Ah, the advancements of technology. Study hard, have to learn every single medicinal fact about +600 species... only for the eggheads to design a machine that heals Pokemon at the cellular level at the push of a button- and not even have to worry about taking them out of their Pokeballs.
Most of the wild Pokemon you encounter were specially taught by the Nurse Joy family to annoy and battle Trainers and force them to return to Pokemon Centers. They were released so as to not raise suspicion as to why they can't be captured.
Why else would there be a Pokemon Center right next to Mt. Moon?
this is how i interpreted this: joy has altered the machine so that it slightly alters the pokemon's cellular structure. each time a healing device is used on it, one that deals directly with the pokemon's physical makeup (mainly repairing it, such as man-mad cures like potions, antidones, and indeed, the healing machines themselves), an effect is triggered. while healing does, in fact, take place, an amount of the pokemon's cells are corrupted and/or destroyed. this creates a cancer-like effect if repeated enough times. that is why, in the games, potions heal you less as you go on. it appears that it is merely because your pokemon has amassed more health, and while that is in fact the case, nurse joy's destructive influence is also taking hold of your partner's body. her ultimate aim is to have trainers unintentionally kill their own pokemon by using restoratives. there are few who have learned of joy's twisted intentions, and now opt for more natural means to cure their friends of what ails them. this is the reason for the expanding number of vending machines throughout the recent games, as certain officials have been able to combat, at least in some small way, the unintentional killing of pokemon. many rangers have lost a dear friend to joy's foul machinations, and have therefore defected from much of the ultra-modern society seen in larger cities, now wary and paranoid of hidden dangers cloaked in an amicable facade. this is why many of them give you berries. few believe those accusing joy of evil, so the rangers instead try to provide an alternate opportunity without making the trainer reject them outright. i didn't think i would be typing that much.