Given the same sum of individual values, the most powerful distribution is the one that compensates for a Pokémon's weakest base stats.
Let me begin by introducing two premises:
Every Pokémon species is characterized by base statistics. For example, Pidgeys have a base attack of 94, base defense of 90, and base stamina of 80. Any particular Pokémon's stats are the three sums of its individual value plus its species' base stat, so the actual stats of a Pidgey with IVs of 10-10-10 would be 104, 100, and 90.
Attack, Defense, and Stamina have almost* strictly proportional importance. Regardless of the numeral value of a particular stat, doubling it will make you twice as effective and halving it will make you half as effective. Defeating your opponent twice as quickly, taking half the damage from their attacks, or being able to take twice the damage on the nose all result in the same capacity to fight and win against an opponent who is 200% as strong as otherwise.
* (I say "almost" because stamina actually has a knock-on effect that results in more energy for charge attacks. Also, while defense and HP will enable you to win a more difficult fight, attack will help you finish it faster, and I assume your time has value.)
Observe that though the first premise describes an additive relationship, the second describes a multiplicative one. The magnitude of these values is all relative. What you want are not the biggest numerical additions, but the greatest percent increases.
By way of example: Chansey is a Pokémon with extremely unbalanced base stats; she has only 40 base attack and 60 defense, but a phenomenal 500 base stamina. Getting an attack IV of 15 would constitute a 37.5% gain in actual power over the having an attack IV of 0, but a stamina IV of 15 would only be a 3% gain over the base. Literally, just two points of attack IV will eclipse the worth of a maxed out stamina IV. Same goes for defense. Yes, that means a 10-0-0 Chansey rated at only 22% "perfection" will outshine a 0-5-15 specimen rated 44% "perfect."
HP and Defense are more important for Pokémon you intend to train at friendly gyms.
In this, there are, again, two premises:
More Prestige is awarded for using a Pokémon with less CP. Ideally, you want your Pokémon to have half the CP of the defender for the greatest prestige gains. You're assisted in this endevour by dodging, exploiting type weaknesses, deliberately placing a defender who sucks, and by understanding that...
The CP formula overvalues attack quadratically, compared to stamina and defense, and, um... cube-root-zenzically, compared to the level coeffecient. The CP formula question is
(ATK*sqrt(DEF*STM)*CPm^2)/10, but a better approximation of a Pokemon's power would be
ATK*DEF*STM*CPm^3, where CPm is the level coefficient.
I dunno why Niantic based CP on such a skewed approximation, but you can exploit it by favoring stamina and defense and minimizing attack, which will result in the greatest (favorable) disparity between your CP and your actual combat viability. Yes, this means a 0-15-15 Pokémon, rated only 66% "perfection," is actually the ideal candidate for raising prestige.
Among your Magnificent Six, Attack has the greatest utility.
When you attack an enemy gym, you get to bring six entire Pokémon and there is literally no single defender who can stand up to that kind of heat. With enough potions and time, you and your boys can raze absolutely any enemy gym, period.
Since merely winning is assured, the strategy is in minimizing the resources you're burning, which, as stated, are potions and time. To to this, you need to shorten the fights, which you can achieve by emphasizing offensive power.