The goals of the F35 were to be the fighter for all the branches of the military. The problem is that they all have very different requirements.
Marry that with a tech-fixes-everything attitude and you have a Frankenstein of an aircraft with so much "technology" that it gets in the way of the human pilot's instincts.
And lastly, the project has been strategically split up by contractors in a way that it creates jobs in so many congressional districts, so congress members are loathe to shut down a program that brings jobs in their district.
All this is done by PRIVATE sector contractors.
In defense companies these days, they usually do what are called "cost plus" contracts. That means the government pays them whatever it costs to do the job, plus a profit margin. So, the incentive is to bloat the project beyond all belief, because that increases the costs. Then the profit is multiplied, since the profit margin is fixed.
Splitting the project up among a ridiculous number of contractors to cover as many congressional districts as possible doesn't help the situation.
Basically, the F-35 is a huge make-work program for the US.
A lot of the blame comes down to voters. They refuse to pay teachers a pension and demand they be paid based on performance, but they approve a higher defense budget because spending more on guns is never a bad idea.
That is: Defeating intelligent adversaries is considerably more difficult than defeating gravity.