The Hydrogen Phosphate anion is made up of Covalent bonds. The overall charge of $-2$ that it has can be seen by its tetrahedral structure:
The four Oxygen atoms do not each contribute a $-2$ charge to the molecule, but rather two of them contribute a $-1$ charge each.
I think you are confusing Oxidation state, or 'charge' and valence state.
Oxidation state is the formal number of electrons added/removed from an atom when it forms a compound. Here, we have a covalent anion so the electrons are only formally removed, but it is still a useful formalism and can be used here to calculate the $-2$ charge :
Oxygen's valence state, the number of valence bonds used in bonding, is $-2$ and for Hydrogen it is $+1$ as you correctly said. Here, these are the same as their Oxidation States. But for Phosphorus, we must assign a $+5$ Oxidation state to it in order to obtain the overall $-2$ charge. Note that Phosphorus is not actually losing 5 electrons to form a $+5$ cation, this is a formalism, as aforementioned.
Because the anion is covalent, you cannot just treat each atom as an ion in its 'normal' oxidation state and try to add them up to obtain the charge.
You CAN do this for $K^+$ and $HPO_4$$^-$$^2$ because these form an ionic compound, so the charges simply add: Two $K^+$ and one $HPO_4$$^-$$^2$ will combine to produce the overall $0$ charge ionic molecule (As shown in the diagram, but for $Na^+$ rather than $K^+$.