I think part of the interest in catching gyms is like the above said for bragging rights, also when a gym successfully repels an attack it tracks and gives you a number for how many battles you have won, ego boosting for the win
It's basically turf wars. Never ending tug-of-war.
But like every team-based activity, coordination will trump over randomly doing things solo.
Every gym quest should follow as such:
1. Group of preferably 3-4 individuals minimum should tackle the target gym with their strongest Pokémon
2. As soon as the team notes the gym prestige is about to hit zero, one team member needs to stay on alert to ninja insert a somewhat weak Pokémon as the initial "training dummy"
3. As soon as the first Pokémon is inserted into the team, all members are to battle nonstop to raise the gym's prestige with one or two members inserting a mid-tier Pokémon as a stopgap for enemy teams, but also as an advanced training dummy to speed up prestige leveling
4. The remaining members of the team should insert one of their strongest Pokémon as anchors for the gym; of course, bearing in mind type diversity to make it more difficult for opposing teams to straight counter
The highest level gym I was part of was seven layers deep, with the first three Pokémon in mid-tier level (around ~CP1000), two Pokémon in the middle in the 1300-1400s (I had a CP1490 Exeggutor stationed here), and two high level anchors (1600+; this one in particular was anchored by a CP1800 Gyarados).
A Clefable or Snorlax up in the front lines tend to work well in my experience.
But regardless of how potent your gym is, eventually it's going to go down, especially if it's in a densely populated area where it's going to be numerous teams going against you simultaneously. It's just a matter of how tryhard you want to be and make that gym last as long as possible. And yes, that gym I was part of only lasted about 30 minutes, which in that area of NYC is actually an incredibly long time. Most gyms in NYC hotspots go down in a matter of minutes or even seconds as soon as they're claimed.
Gym leaders are gym leaders because they have the strongest Pokémon in the team. If you don't want to get stuck being a defense grunt, then get higher level Pokémon.
What I do think they need to improve is the method of resource collection (specifically coins). They probably didn't foresee how ridiculously fast people will try to claim and take down gyms, thereby not allowing many people to be able to set up any sustainable "income."