This way of teaching math worked the best for me:
1. A new algorithm is presented
2. The new algorithm relies on a related theorem (or theorems)
3. The entire class is spent proving the theorem rigorously
4. Once you have proved the theorem you can then proceed to use the related method, to solve problems
On midterm and final exam tests, as well as assignments, we were asked to use the method we learned in ways we haven't seen before. We were also often asked to prove similar theorems (that we hadn't seen before either), for example with 1 extra dimension.. i.e. similar idea, different details
Since you couldn't predict what sort of stuff you would see on midterms and final exams, you had to actually understand the theorems and how they work. You had to understand the principles behind what was going on, so that you could apply them in situations that you've never seen before. The best way for learning this was to prove everything, and understand why things were proved the way they were, and what the thinking behind every step was. It forced you to eventually see the big picture, which is vital.