I've just finished a Classical Mechanics course, and looking back on it some things are not quite clear. In the first half we covered the Lagrangian formalism, which I thought was pretty cool. I specially appreciated the freedom you have when choosing coordinates, and the fact that you can basically ignore constraint forces. Of course, most simple situations you can solve using good old $F=ma$, but for more complicated stuff the whole formalism comes in pretty handy.

Then in the second half we switched to Hamiltonian mechanics, and that's where I began to lose sight of why we were doing things the way we were. I don't have any problem understanding the Hamiltonian, or Hamilton's equations, or the Hamilton-Jacobi equation, or what have you. My issue is that I don't understand why would someone bother developing all this to do the same things you did before but in a different way. In fact, in most cases you need to start with a Lagrangian and get the momenta from $p = \frac{\partial L}{\partial \dot{q}}$, and the Hamiltonian from $H = \sum \dot{q_i}p_i - L$. But if you already have the Lagrangian, why not just solve the Euler-Lagrange equations?

I guess maybe there are interesting uses of the Hamiltion formalism and we just didn't do a whole lot of examples (it was the harmonic oscillator the whole way, pretty much). I've also heard that it allows a somewhat smooth transition into quantum mechanics. We did work out a way to get Schrödinger's equation doing stuff with the action. But still something's not clicking.

My questions are the following: Why do people use the Hamiltonian formalism? Is it better for theoretical work? Are there problems that are more easily solved using Hamilton's mechanics instead of Lagrange's? What are some examples of that?

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.
