Quoted By:
The way I see it is that because there are so few trainers who are dedicated strictly to battle the money kinda just leaks in from other professions that trainers.
Think of it this way. You, your rival(s), and ace trainers are for the most part the only trainers who actually compete for badges and aim to become champion. Everyone else has some kind of job on the side to occupy them, kids have school and prize money is their allowance, business people in Castelia certainly aren't full time trainers, even the Gym Leaders have proven to have side jobs or passions that they also follow. It's just that for most of the game you will battle and gain prize money from these people.
The point is that being a real trainer is tough. Only the really good ones can make enough money to live comfortably. If you suck then you don't get money, if you don't get money then you find something that will get you money so you don't live out on the street with a "will battle for $$$" sign in your hand. For every winner there is a loser and Veterans/Ace Trainers/Gym Leaders and those lot have proven that they are the 50% who can keep winning enough to not become poor.
As for Pokemon Centers and the like, those are payed for by either the tax payers or by various competitions held by the Pokemon League to raise the funds. The things in the Pokemarts could also be marked up slightly to cover free Pokemon healthcare.