Feeding berries is not about maxing the amount of coins you gain from gyms. You don't get coins for catching Pokémon either, but people still do it because they consider it a fun part of the game.
Some people take it as a point of pride to hold gyms for their team. I love the feeling of taking all the gyms in an area from a rival team. Even in locations where I know they'll take them back before I get home, it's satisfying to know I've made them work for it. For this same reason, I'll feed berries to gyms that I don't even have any Pokémon in. They're my team; I have to help them out!
Another good reason to keep your Pokémon in a gym for a long time is to level up your gym badge. You get something like a point for every minute your Pokémon defends, which is really your only hope of getting a high level badge. You get an extra item for every level of badge you get, so if it's a gym you walk past a lot, it can be a nice benefit. Keeping the gym under the control of your team nets you another item, so that's another reason to help your team out.
Lastly, although a fully motivated gym is unlikely to stop a determined attacker, it will prevent attacks of opportunity. If I happen to be walking past a rival gym, and it's full of high level, fully motivated Pokémon, I'll usually keep on walking. However, if they're all low CP and will get knocked out with one battle, I'll definitely stop and clear it out. So assuming you care about holding gyms in general, it's definitely worth feeding berries when you can.
Personally, even if these reasons were not particularly compelling for me, I'm going to end up trashing the berries anyway to make room for other items. I figure I may as well put them to use instead.