How do I get the most torque out of a spanner?
The first thing I would think about is not how I get more torque out of a spanner, but why I need to. Your average spanner (wrench) produces a lot of torque, and adding more in some cases is likely to break whatever it is you are trying to fix, rounding off the nut, or breaking the tool (as you experienced). It's far better to figure out why something is stuck and trying to remedy that by using some penetrating fluid like wd40 or the like, or maybe some gentle tapping with a mallet in a strategic place. 

To answer your original question a piece of pipe is my standard solution for those extra torque situations just as you used, but it helps to have good quality steel tools and not cast chromium alloys as the last tend to shatter.