 The second law, the idea of entropy, that if you could somehow avoid losing energy in the system to friction or heat, which isn't going to happen, the energy within the machine would still spread out and become less organized over time. It couldn't keep running forever without additional energy input, which makes it not a perpetual motion system.