Costs on the face of it look absurd, but they fund an ecosystem of companies to do R&D that can have civilian applications as well as feed into military projects.
My friend use to check circuit boards for F-15s at the Boeing plant in Los Angeles. He said they would throw out a board out if there was even the slightest chance of fault. He might have to throw out 100 boards to get one perfect board. Sure it’s costly, but the dud rate for American weapons is now very low. Not to be blunt but Does China have that kind of quality control? American platforms are reliable and last for decades, and sometimes you need that platform to be just that little bit better than the other guys stuff to make the difference.