The expensive hammer thing is in part because the military has someone contrive a series of qualifications any "hammer" has to pass. There is a series of tests I once had to have run called JANAF tests, Joint Army Navy Air Force tests. Outside companies run these tests. If you fail something, even something trivial and irrelevant, you have to redesign your "hammer" to pass, even if the regular hammer would work just fine. And the tests are easy to fail. One part of the for example if flammability.
So, you make nice hammers, but they for example fail a flammability test. You make 10 million a year, and the AF wants 1,000. Do you redesign your hammer to make 1,000? Yup, but only if you can charge up for the hammer, and you probably know no one else out there will compete.
So you make what might be cheap crappy 1,000 hammers that pass all the tests and sell them for $1,000 each, and every mechanic in the AF goes out and buys their own hammer for $10 because the issued hammers are crap, but they pass tests.