It's easy to keep your legs straight when you're standing up or laying flat on your back, but as soon as you try to sit up or bend down, you need to bend your knees as well as your waist. (Try it. Lay down flat on the floor, then try to sit up straight while keeping the backs of your knees pressed against the ground. You'll have trouble long before you reach 90 degrees.)
Why is this?