Responding to ever changing requirements from the customer. When each service competed its own aircraft (i.e. Navy Tomcat vs AirForce Eagle) it was simpler. Now everything must be joint and and the government wants to buy one tool to do all jobs. F-35 has to have three variants (A, B, C) to satisfy Navy, Marines, and Air Force, and the requirements keep changing. That costs schedule and money. On top of that, the contractors were forced to include NATO countries in the procurement process. So not only parts made in multiple states (so each Senator gets his/her cut) but across England and other European countries as well. The contractors are stuck with the mess the US government forces upon them.
All of what you wrote sounds like a very poor excuse for failure instead of a good reason.
It has been 20 years. Actually, more than 20 years. Development began in 1995.
If Lockheed could not deliver the product they should have never taken the contract.