Part of it is the sophistication. Take the Tomahawk: assumed range of ~1000 miles , estimated accuracy of 30 feet. Can launch from above or below water. Etc.
The other part is the limited production runs. Until last month, the DoD was generally purchasing ~100 of these annually. There's no scale economy in making these, so those 100 missiles need to support the entire production & R&D of the product.
I imagine part of it is also zero acceptance for failed launches. It needs to always work
It's worth reading up on the history of the Sidewinder development for the other side of this coin. Radically cheaper than the conventionally-developed alternatives at the time. It's grown legs in more recent marks but the first few variants were really not sophisticated at all.