It is true and it is a problem at the macro level. Once you add in BAS and BAH, and correct for tax advantages, the average O-3 with 6 years of service (and no bonuses/special pays) makes $92K (OSD calls this RMC - Regular Military Compensation). Even without any spousal income or monetary advantages from deployments, that's in the 75th percentile for US median income. At least in the Air Force, we have a retention problem... we have way too much of it (fighter pilots excepted). Very shortly, I'll be an O-4. Looking at my numbers...that puts me in the 82nd percentile for median income. No wonder not enough O-3 to O-5s are leaving the Air Force: there are clear financial incentives to stay. There may be a pay gap for the enlisted folks compared to equivalent civilian careers. I believe strongly that the opposite is true for officers. Where else can a history or English major make $100K after 8-10 years and join the check-of-the-month club after 20?
Sure...there's unique hurdles. I believe they are much less than they were in the mid-90s or earlier. CPI isn't a real good comparison to military pay increases because the biggest factor in CPI changes over the last decade or so have been the dramatic increases in medical care cost... which we haven't had to pay for out of pocket (you could make an quality-change argument here, but costs to the member have been the same...)
As for spouses, I'm seeing an increasing number of wives who are able to become location-independent through telework or other internet technologies. It's far from a significant population, but I see it moving upward. The days when a the career expectations of a spouse were mom, teacher, nurse, or clerical work are done.
Quite a few states offer in-state tuition for dependents even if the sponsor moves. On top of that, the ability to hand over Post 9/11 GI bill benefits to dependents is huge.
Garnish all of this with the absolutely phenomenal retirement system we have and the eligibility for VA home loans, and you have a system that is simply blows the doors off of civilian compensation for most careers.
I'm not saying everything is a bright and shiny bowl of happiness in the military... just that I think we haven't faced nearly the same compensation challenges as those on the outside. If I compare myself to the average guy on the outside who got his CPL the same year I got commissioned...I'm doing much better (he's probably a regional FO. Maybe regional CA if he got lucky). The same is true if I compare myself to someone who started civil service as a GS-9 and grew to a GS-13 (they haven't gotten a raise in the last three years..no ECI/CPI arguments there).