I personally disagree with the last answer. HP is, in a way, a mix of defense and special defense. Lets look at a calc real quick:
0 Atk Victini V-create vs. 0 HP / 252 Def Manaphy: 42-51 (12.3 - 14.9%)
0 SpA Victini Blue Flare vs. 0 HP / 252 SpD Manaphy: 42-51 (12.3 - 14.9%)
In this example, I have a blank set of Manaphy and Victini, but the Manaphy has 252 EVs in Defense and Special Defense (I also set V-create and Blue Flare's base power to 100 both to more evenly show the damage). Now, if we replace the defense/special defense EVs for HP we get...
0 Atk Victini V-create vs. 252 HP / 0 Def Manaphy: 54-64 (13.3 - 15.8%)
0 SpA Victini Blue Flare vs. 252 HP / 0 SpD Manaphy: 54-64 (13.3 - 15.8%)
(Same set up as last example.) The amount of damage Victini does to Manaphy increased compared to the defense/special defense EV spread. So in the case of leftover EVs, you usually want to invest in either defense or special defense instead of HP to cover a certain weakness, such as Garchomp's or Landorus's severe ice weakness. You could throw in a few leftover EVs into SpD to maybe tank ice beams from Vaporeon and such.
Back to what the question is saying however. To demonstrate this, I'm going to split Defense and Special Defense EVs so there are only 124 in each stat, and the useless leftover 2 EVs in each into the HP stat so we get only one extra HP point.
0 Atk Victini V-create vs. 4 HP / 124 Def Manaphy: 48-57 (14 - 16.6%)
0 SpA Victini Blue Flare vs. 4 HP / 124 SpD Manaphy: 48-57 (14 - 16.6%)
(We already calc'd max HP above, second example. Same set-up here.) As you can see, Victini's damage did even more than before.
To answer your question, I recommend to invest in one stat completely. Unless you know what you're doing and mess around with stat calcs a lot, I'd recommend going full HP EVs, Defense EVs, OR Special Defense EVs, instead of a mix of defense and special defense. I like to think of these EVs as kinds of 'multipliers,' in a way. HP EVs are like 1x multipliers, and Defense/Special Defense EVs are like 2x multipliers (NOTE: these are not exact figures and EVs do not actually multiply stats, its just my little way of remembering it). And technically speaking, it is smart to sometimes invest in both HP and a defensive stat to cover your other defensive stat's weakness with the extra HP.
Hope this helps. Ask if you have any more questions. :)