Variable shape wings (or variable geometry) have a number of uses, primarily in being able to optimize the shape of the wing to an ideal form for the regime of flight.
The idea isn't new; birds, bats and other flying creatures twist and warp the shape of their wings in order to maneuver and generate thrust as these pigeons demonstrate.
The Wright Brothers used a warping wing box on their gliders and the 1903 flyer. Orville Wright is said to have come up with the idea while twisting a rectangular cardboard box used to ship bicycle tire inner tubes.
The chief advantages to such a design are that it provides an extremely clean airframe, aerodynamic wise, without joints, separate control surfaces, moving parts, etc which create excess drag. In addition, the aircraft shape can automatically be optimized to the altitudes, speeds and Mach numbers desired without tradeoffs for weight or performance required with aircraft made from conventional materials.
The downside to warping wings is solving the problem of finding materials which could be flexible and change their shape and then remain rigid and immutable under aerodynamic loads. Wood and metal airframes lacked the capability to do this successfully.
Early attempts to solve this problem have been to make 'swing wing' designs where the wing can be rotated at the wing root to an optimal sweep in flight. The Bell X-5 successfully demonstrated this concept and it has been used on a number of military aircraft including the F-111, F-14, MiG-23/27, B-1, and SU-22.
NASA is currently developing a morphing wing for these reasons. If successful and shown to be feasible from a manufacturing and service standpoint, it would be a game changer.