Some of the flex is lost as heat in the parts that are bending. The more bending you do, the more energy is lost through heat. However, this is a very miniiscule amount. A much larger proportion of the inefficient loss of power is in moving the soft fleshy human body around laterally in motions that's useless in moving the pedals down. Also on a single standing stroke you're using more of your body's mass, but before the very second stroke, you have to move that body mass back up in order to drive down the other pedal. You basically have to give back the extra push on the opposite side.
The real source of the extra power is that you get to use some of your strongest muscles at their most poweful part of their motion, near the limits of extension. So standing up lets you use several of your muscles to full contraction, giving you more power. However, making muscles exert near their maximum force is also inefficient, consuming more oxygen per watt generated than sitting down. You also drive them over their lactate-threshold easier, thus you won't be able to keep it up as long.