I think A) our society could really do a much better job signaling what military service actually entails, and B) explore some middle-ground possibilities between civilian life and military service. I think one issue is that, for some reason, civilians are convinced that service-members are drastically underpaid which couldn't be farther from the truth. When you tabulate the entire benefit package, regardless of rank, it's really quite good. That ignorance persists even among active-duty members, typically the younger guys. They'd bitch about how "I could be back home making $15/hr working construction!" without recognizing and counting the health insurance, pension, guaranteed full-time pay for the extent of the contract, and 30 days paid vacation a year.
Practically everyone on this thread has pointed out that the problem begins at home -- the military can be a new home and I participated in that process myself as a mid-20's NCO counseling young men that very obviously had a much different background. Teaching them how to play the game (STFU and work hard), teaching them how to approach new problems, etc etc.
As an aside, it cracked me up when my loser civilian friends would wax poetic about how they're "really thinking of enlisting but just can't give up my freedom, man!" As they're working two shithole part-time jobs, living uninsured, and steadily accruing debt.