Why is it impossible to build a machine that produces more energy than it uses?

2 answers

Because there is no such thing as perpetual motion. Another way to say it is that the effeciency would need to be greater than 100% and that can't be.
Efficiency can never reach 100% because there's always loss of energy during the process of carrying out work. One example is energy loss because they're converted into heat while operating.