I'm compensated fairly, and my pension makes it actually quite well compensated. The career does suck and I wouldn't recommend it to anyone, but for someone needing mobility from generational poverty it can work.
The career opportunities upon retirement are nothing to be trivialized either. Compensation there may not be SWE level, but it's WELL above median.
Aside from monetary compensation (which can range widely, and typically is made up of 25-50% tax sheltered disability pay) there is health insurance at a maximum out of pocket of $3600/year for a family ($600 premium plus $3000 catastrophic cap), tax free shopping, discounted fuel, free flights, remarkably cheap lodging all over the US and in allied countries, and the list goes on.
The last calculation I saw for an average Senior Enlisted retiree was that you would need a lump sum of in excess of $3 million to hope to compare, invested at a decent return. Albeit that’s not completely accurate, but it’s as close as we can get given such different financial vehicles.