Why doesn't this perpetual motion machine work? Imagine a non-magnetic tube bent into the shape of a triangle, with two sides forming downhill ramps, and the third side connecting the two ramps. Through this tube travels a metal ball, which is pulled back at the top with a magnet. When the ball gets back to the top, a small part of the energy generated by falling (or a pin and spring) is used to insert and remove a strip of some antimagnetic material (if that exists), causing the ball to repeat the cycle. The image below is a diagram of the machine.

Why doesn't this work? 
 A: The key here is the antimagnetic strip, quite aside from whether or not such a device can be built.
When you insert the anti-magnetic strip, you must change the shape of the magnetic field. You must force the magnetic field to "leave" the high permeability ball. The same magnetic induction $|\vec{B}|$ in a high permeability $\mu$ material represents a lower energy of genesis of the magnetic field $\frac{1}{2\,\mu} |\vec{B}|^2$ than it does in a lower permeability material (magnetic induction is continuous across the magnet's face whatever is outside). So to exclude the magnetic field, you have to do work pushing the antimagnetic strip in. The ball then falls, and you pull the strip out. However now there is no high permeability ball in contact with the strip, so there is little change in the magnetic field configuration when the strip is pulled out, and any work done on the strip as it is withdrawn will be very much less than what you put in to push the strip in. When the ball crashes at the bottom it dissipates the energy that ultimately came from your pushing the antimagnetic strip in as heat, and then the cycle repeats: you have to do the amount of work lost by the ball on crashing inelastically with the ground on the antimagnetic strip at each cycle.
You can, in principle, recover some of the ball's kinetic energy as it hits the ground to help do some of this nett work on the antimagnetic strip by the schematic "tredle" device you show linked to the magnet. However, this is the point at which rob's answer comes in: you might make a lovely art piece that runs for a while, but, if there is any energy loss, anywhere, the machine will stop eventually.
Turning your question around: the ultimate "reason" is that we have never experimentally observed a nonconservation of energy. By experimental induction, therefore, we postulate a principle of conservation of energy and thus the machine cannot work. However, if so, then a theorist can work out what kinds of properties of an antimagnetic strip are physically plausible: only those properties which would demand a net input of energy in the way I describe in my answer are plausible i.e. consistent with overwhelming experimental evidence.
A: If the magnet is strong enough to pull the ball up the bottom slope, it will be too strong to let the ball fall.  Even worse, as you have drawn the diagram the magnet is pulling the ball down the lower slope when it is toward the left end.  Anywhere to the left of where the perpendicular from the magnet to the ramp, the magnet is pulling more right than up.  If the magnet is very strong, the ball will get stuck where the magnet force is perpendicular to the ramp.
A: You might be able to get it to work for quite a while, depending on your skill as an engineer. But there is a critical difference between a well-engineered machine that runs for a while, and a perpetual motion machine that runs forever without input. The latter is impossible.
A: There is a confusion between the terminology "perpetual" , which means "continuously",  devices that almost move forever, and a machine that can produce energy. As the other answers point out energy is conserved and if it looks as if energy is provided from nothing  a closer analysis shows the mistake, as in the drinking bird perpetual setup. In the case of the bird it is a small heat engine 

An analysis showed that the evaporative heat flux driving a small bird was about half a watt, ......The system efficiency is about 0.01%. More practically, about 1⁄1000000 of a watt can be extracted from the bird, either with a coil-magnet setup or a ratchet used to winch paperclips.

In your particular setup there does exist a magnetic field obstructing metal called mu-metal. You would have to rotate a screen in just before the magnet picks up the ball. Then you have to rotate the screen out when the ball reaches the angle at left after being kicked by the spring ( which I suppose it is at an angle). This eats up energy and the spring will eat up energy . If engineered carefully it might work for some time , until the magnet demagnetizes, because it is the magnetic field that supplies the energy to lift the ball up that is recovered by the fall. I suspect that the efficiency of such an engine, i.e. if you try to extract energy, will be even smaller then with the perpetual bird. Particularly as you would need some electronics to rotate the screen in before the ball sticks to the magnet , .
A: Too many abrupt changes in direction. Also, is this spring powered? If so, I would think it to be simpler by using an electromagnet to apply and cut voltage. More moving parts mean more opportunities of failure.
