There are several reasons for using the Hamiltonian formalism:
Statistical physics. The standard thermal states weight of pure states is given according to
$$\text{Prob}(\text{state}) \propto e^{-H(\text{state})/k_BT}$$
So you need to understand Hamiltonians to do stat mech in real generality.
Geometrical prettiness. Hamilton's equations say that flowing in time is equivalent to flowing along a vector field on phase space. This gives a nice geometrical picture of how time evolution works in such systems. People use this framework a lot in dynamical systems, where they study questions like 'is the time evolution chaotic?'.
The generalization to quantum physics. The basic formalism of quantum mechanics (states and observables) is an obvious generalization of the Hamiltonian formalism. It's less obvious how it's connected to the Lagrangian formalism, and way less obvious how it's connected to the Newtonian formalism.
[Edit in response to a comment:]
This might be too brief, but the basic story goes as follows:
In Hamiltonian mechanics, observables are elements of a commutative algebra which carries a Poisson bracket $\{\cdot,\cdot\}$. The algebra of observables has a distinguished element, the Hamiltonian, which defines the time evolution via $d\mathcal{O}/dt = \{\mathcal{O},H\}$. Thermal states are simply linear functions on this algebra. (The observables are realized as functions on the phase space, and the bracket comes from the symplectic structure there. But the algebra of observables is what matters: You can recover the phase space from the algebra of functions.)
On the other hand, in quantum physics, we have an algebra of observables which is not commutative. But it still has a bracket $\{\cdot,\cdot\} = -\frac{i}{\hbar}[\cdot,\cdot]$ (the commutator), and it still gets its time evolution from a distinguished element $H$, via $d\mathcal{O}/dt = \{\mathcal{O},H\}$. Likewise, thermal states are still linear functionals on the algebra.
The problem is that the Lagrangian and the Hamiltonian are functions of different variables, so you must be exceedingly careful when comparing their partial derivatives.
Consider the differential changes in $L$ and $H$ as you shift their arguments:
$$dL = \left(\frac{\partial L}{\partial q}\right) dq + \left(\frac{\partial L}{\partial \dot q}\right) d\dot q$$
$$dH = \left(\frac{\partial H}{\partial q}\right) dq + \left( \frac{\partial H}{\partial p}\right) dp$$
Finding $\frac{\partial L}{\partial q}$ corresponds to wiggling $q$ while holding $\dot q$ fixed. On the other hand, finding $\frac{\partial H}{\partial q}$ corresponds to wiggling $q$ while holding $p$ fixed. If $p$ can be expressed a function of $\dot q$ only, then these two situations coincide - however, if it also depends on $q$, then they do not, and the two partial derivatives are referring to two different things.
Explicitly, write $p = p(q,\dot q)$. Then using the chain rule, we find that
$$dH = \left(\frac{\partial H}{\partial q}\right) dq + \left(\frac{\partial H}{\partial p}\right)\left[\frac{\partial p}{\partial q} dq + \frac{\partial p}{\partial \dot q} d\dot q\right]$$
So, if we shift $q$ but hold $\dot q$ fixed, we find that
$$ dL = \left(\frac{\partial L}{\partial q} \right)dq$$
while
$$ dH = \left[\left(\frac{\partial H}{\partial q} \right) + \left(\frac{\partial H}{\partial p}\right)\left(\frac{\partial p}{\partial q} \right)\right]dq$$
If $L(q,\dot q) = H(q,p(q,\dot q))$ as in the case of a free particle, then we would find that
$$dL = dH$$
so
$$\left(\frac{\partial L}{\partial q}\right)= \left(\frac{\partial H}{\partial q} \right) + \left(\frac{\partial H}{\partial p}\right)\left(\frac{\partial p}{\partial q} \right)$$
We can check this for the free particle in polar coordinates, where
$$L = \frac{1}{2}m(\dot r^2 + r^2 \dot \theta^2)$$
$$ H = \frac{p_r^2}{2m} + \frac{p_\theta^2}{2mr^2}$$
$$ p_r = m\dot r \hspace{1 cm} p_\theta = mr^2 \dot \theta$$
for the left hand side,
$$ \frac{\partial L}{\partial r} = mr \dot \theta^2$$
For the right hand side,
$$ \frac{\partial H}{\partial r} = -\frac{p_\theta^2}{mr^3} = -mr\dot\theta^2$$
$$ \frac{\partial H}{\partial p_\theta} = \frac{p_\theta}{mr^2} = \dot \theta$$
$$ \frac{\partial p_\theta}{\partial r} = 2mr\dot \theta$$
so
$$ \frac{\partial H}{\partial r} + \frac{\partial H}{\partial p_\theta} \frac{\partial p_\theta}{\partial r} = -mr\dot \theta^2 + (\dot \theta)(2mr\dot \theta) = mr\dot \theta^2$$
as expected.
Your mistake was subtle but common. In thermodynamics, you will often find quantities written like this:
$$ p = -\left(\frac{\partial U}{\partial V}\right)_{S,N}$$
which means
The pressure $p$ is equal to minus the partial derivative of the internal energy $U$ with respect to the volume $V$, holding the entropy $S$ and particle number $N$ constant
This reminds us precisely what variables are being held constant when we perform our differentiation, so we don't make mistakes.
Best Answer
The functional form of T is different in Hamiltonian (H) and Lagrangian (L) formalisms. In L formalism, T is a function of $q_j$ and $\dot{q}_j$, while in H formalism it's a function of $p_j$ and $q_j$. As an example take T in 2d polar coordinates $$T_L = \frac{1}{2} m\dot{r}^2 + \frac{1}{2} m r^2 \dot{\theta}^2$$ $$T_H = \frac{p_r^2}{2m} + \frac{l^2}{2mr^2}$$ Here $$\frac{ \partial T_L}{\partial r} = mr \dot{\theta}^2$$ $$- \frac{\partial T_H}{\partial r} = \frac{l^2}{mr^3} = \frac{m^2 r^4 \dot{\theta}^2}{mr^3} = mr \dot{\theta}^2 $$