This is because if a Pokemon gained a boost to its base HP in battle, then its HP would change (that's pretty obvious, I suppose). But think about it this way - what if that Pokemon loses HP when it changes form? If it does it in the middle of a battle when it has already taken some damage, would it immediately faint if its HP is low enough? Alternatively, if the Pokemon's HP stat was boosted, what happens to its current HP? Does it stay the same, or does in increase in proportion with its new max HP stat? Keeping the HP as a constant stat eliminates these sort of problems.
The HP stat is calculated differently from the other stats, so it isn't a good idea to group it together with Attack and the rest of them. You might also notice that natures can never lower or increase HP, which is another difference.
In short, HP is the most visible of the stats, and arguably the most important of them (unless you are a Shedinja), so changing it in the middle of a battle is ill-advised.
Source on calculations of stats