Preventative medicine is cheaper in than curative medicine.
It's much cheaper to have the military prevent our country from being invaded in the first place than to have to treat the people who were injured (or psychologically traumatized) by the invading army.
The military is the ultimate preventative medicine, and every penny you spend on the military is roughly a dollar that you don't have to spend on medicare.