tl;dr summary: Software Engineering is a young discipline that is still figuring out how to build complex projects, and 8 MLOC is a very large and complex project.
Software Engineering is young. Very young. Like, two orders-of-magnitude younger than other engineering disciplines. Software Engineering started with the First NATO Software Engineering Conference in 1968, whereas e.g. Civil Engineering, Structural Engineering, and Mechanical Engineering started more or less with the building of the Great Pyramid … that's 60 years vs 4600 years of experience.
Or, to put it bluntly: we haven't figured it out yet.
There are a couple of things that make Software Engineering different from other engineering disciplines, most importantly the fact that software can be copied and re-used at no cost, and that software can be abstracted, parameterized, and generalized. What this means is that usually we only build things that nobody has ever built before, because if someone had built it before, we could duplicate that solution at no cost. This is different from e.g. structural engineering. You cannot just snap your fingers and clone a bridge, but you can do that with software.
So, other engineering disciplines have decades, centuries, even millenia of experience perfecting building (more or less) the same thing over and over again, whereas SE has only 6 decades of experience building completely new things every time.
Oh, and make no mistake: if you think comparing the F-35's software system to one of the Great Wonders Of The Ancient World is unfair to the herculean efforts by the ancient Egyptians, I would argue that the complexity of building a software system as sophisticated and advanced as the F-35's with its avionics, sensor fusion, and virtual reality environment (to name but a few) is comparable to the complexity of building something like the Great Pyramid.
The F-35 is actually not one plane but three. The F-35C has larger wings, so its aerodynamics are different. The F-35B is actually two completely different aircraft in one, one which generates lift with its wings and one which generates lift with its fan and engine nozzle. While this project saves cost and reduces complexity (at least that's the idea, there are people claiming otherwise) compared to developing and maintaining three different airplanes, it obviously adds complexity compared to each individual plane that would hypothetically have been developed instead, had they not chosen the "Joint" concept.
Add to that the fact this is a government project, where you have many potentially conflicting interests influencing the project that actually have nothing to do with the intrinsic functional or even non-functional requirements of the project.
8 MLOC is a large project. Think about the Linux kernel, its total size is about the same (~10+ MLOC at the moment, I think). But, roughly 90% of that codebase are device drivers (for example for dozens of graphics cards, dozens of SCSI controllers, obscure industrial input and output devices you have never heard of, …), so the actual Linux kernel is only about 1 MLOC. Of that, 90% is architecture-specific support code (for about 20 system architectures from no less than 3 PC architectures (x86 (32 bit), amd64 (64 bit), and x32 (amd64 in long mode, but with 32 bit pointers to save space)) to multiple different ARM, PowerPC, MIPS architectures to CPUs you have never even heard of). So, the real OS is only about 100 KLOC. Now, an OS is generally considered a complex system, and Linux is considered to be a large-ish OS. Well, the F-35's software system is about 100 times as large!
What methods are there to limit development time in large software projects?
That is essentially what Software Engineering is.