At least in the US, military officers don't make a lot of money relative to similar positions in private industry. Their total compensation is often underestimated as it includes healthcare for life, a housing stipend while on active duty, and a pension in retirement, but you might make more as an entry-level software developer than e.g. an Army colonel with 20+ years of service:
https://www.federalpay.org/military/army/colonel
The real money in the military-industrial complex is made by defense contractors, spefically the executives and shareholders of companies like Raytheon, BAE, and Lockheed Martin. Corruption in the upper echelons of US military itself, while far from unheard of, is vigorously investigated and prosecuted by bodies like NCIS. "Fat Leonard"-scale scandals do happen, but are rare:
https://en.wikipedia.org/wiki/Fat_Leonard_scandal