When we say military spending, what it really means is: how much is the US government granting the military industrial complex for them to accept powering its military
When we say Medicaid (and others) spending, it is: how much is the US gov giving to medical insurance companies to allow a sunset of poor people to have some healthcare?
Those companies are intentionally setting outrageous prices and the US is happy to pay them.