Quoted By:
The Electric gym leader in Gen IV was criticised for spending too much money and watsing too much electricity on his gym, which he renovated in his boredom.
The Ground gym leader of Unova, menawhile, obviously funded himself, and was also sort of a leader to his city.
Maybe they're like mayors/feudal rulers and the city pays them taxes (in return they get protection from evil Teams and Rowdies, and attract lots of trainers who spend money in that city's hotels, restaurants, and PokéMarts).