I am from Brazil, a country that has not fought any war since WW2. If you join the army, go fight in Iraq and then return, what will the USA pay you? Is there a health plan for life, a pension, or nothing? Being a soldier is just a temporary job. You earn a good sum of money while you are a soldier, but nothing more than this.
Okay, there is a very real possibility this question will be closed, because it really doesn't fit our guidelines. I may try to edit it later to make it fit in better, but in the meantime, I wanted to provide my own response. Primarily, I believe most people in the US join the military out of a sense of patriotism more than anything else. There are some who do it because it has been done by many generations of family members before them, but generally I believe patriotism is the single most common factor.
Now then, as for the actual answer. The US military provides very good educational benefits which will beasically pay for a full college education for anyone who serves as an elnisted person for at least four years. This alone is a major incentive for a lot of young people. In addition to this, the military provides training in a variety of vocational skills that will allow others who do not want to go to college to gain practical experience that they can then leverage in seeking work in civilian life.
While it is true that you might find similar training in the civilian world, the harsh truth is that most companies that can provide this training won't provide it to young, inexperienced people straight out of high school. The military takes a chance on a lot of people who might otherwise never get that first opportunity. This ia another major incentive for joining.
In the past, during more peaceful times, this was an excellent opportunity for so many under-privileged youth. Now, however, they have to weight their decisions against the possibility that they may have to serve time in a combat zone. The risks are higher, but the benefits haven't improved considerably.
Also, even though military personnel receive an increase in pay while serving in a combat zone, this is not really all that great an increase. The general pay in the military is not that great to begin with. In spite of that, it does truly provide a lot of people who couldn't otherwise find jobs to get an opportunity to receive training and work experience that they can use for the rest of their lives.
I'm adding some stuff I know about that I didn't see in the other answers.
IMHO, the best benifit is free medical care for life in the V.A. system. Most Americans either have to have a full-time (40+hour a week) job with a large company, or be really old or destitute to get paid medical coverage. Everybody else has to buy insurance themselves (and fully 1/4 of the country doesn't feel they can afford that, so they aren't covered at all).
If you join the military you get free medical care while you are enlisted, and then you have a chance at the V.A. system. This is a totally separate healthcare system only available to veterans. It has its plusses and minuses (cheif minus being its really hard to get into), but it is the USA's only totally socialized medical system (hospitals are government-owned, and medical personnel are government employees), so it doesn't suffer from the weirdly skewed visits-and-tests priorities the rest of the USA's medical system has.
Another not-insignificant consideration is that it amounts to a fairly reliable job, that doesn't require a college degree. There is a minimum physical and mental condition they require (adjusted by the vagarities of supply and demand), but otherwise pretty much anyone who wants can get themselves a "job" that way. For those without the money for college and living in communities without a lot of oppertunities for unskilled laborers, this is likely the best deal going. Children of the working poor are highly represented in the US enlisted ranks.
Note that it is in fact a fairly reliable job too. The US Army doesn't often have layoffs. When big wars wind down and they need less people, they just dial back enlistment a notch and the numbers will naturally drop down to the desired level after a while. Even without large wars to fight, the USA has commitments to defend countries all over the world (eg: South Korea), so there's plenty of need for soldiers in "peacetime".
Lastly, they do a lot of other little things. For instance there was a time when it was a quicker way to get US citizenship (yup, you don't have to be a citizen to join the Army!). I had some immigrant friends from Muslim countries who seriously considered this option.
Mostly its not enough IMHO for what we ask them to do for us, but it does seem to be enough to get recruits.
You can find US military pay and benefits information online. The pay, especially for enlisted personnel, is generally lower than comparable civilian jobs both inside and outside the government (officer pay is a bit more even). The benefits aren't bad but can be overly bureaucratic at times.
However, the reason people have volunteered since the draft ended in the early 1970's is either out of a sense of patriotism and/or to access the generous education and training benefits. This varies somewhat by the branch of service. In the Marines, most join for patriotic reasons coupled with risk taking adventure seeking (that was my reason for taking that direction). The Air Force, outside of flight training and a few other specialties, tend to attract those looking for education/training for an eventual civilian job.
America is a very unequal country. The Armed Forces is the "great democratizer," especially for people at the bottom.
American companies generally do a poor job of training their workers. The Armed Forces represent one of the exceptions to the rule. Poorly educated high school graduates come out of the Armed Forces well trained, with marketable skills.
With widespread mechanization, there are relatively few "heavy lifting" jobs for American people whose backs are stronger than their minds. The Armed Forces have a need for physical labor, and the pay for enlisted men and women is better than say, McDonalds. (It's the officers that are paid less than their civilian counterparts.)
Many of the people that join the Armed Forces are unpopular or ostracized in civilian life. The Armed Forces gives such people a sense of pride and belonging "Be all you can be." and "There's strong, and there's Army strong."
Promotions are easier to earn in the Armed Forces than in civilian life. (Except for "fast trackers" from "good schools.") Many people go further in the Armed Forces than they would in the corporate world, and then use their Armed Forces ranks to get good civilian jobs. It's unlikely that Dwight Eisenhower, the son of a mechanic who couldn't send him to college, would have become President of the United States apart from the Army. Colin Powell, a kid from the Bronx who "found himself" in the Army would never have become Secretary of State and a potential Presidential candidate without it. These are "extreme" examples, but illustrate the point.
American society is so violent that the Armed Forces aren't all that MORE dangerous. There's a saying that more Americans die on the highways every year than were killed in the Vietnam War. Casualties in the Persian Gulf War were low, so low that there probably would have been more deaths among the soldiers had they been involved in the only civilian pursuits they had available in the United States.
I think there are the following factors:
State propaganda, including the movies and computer games.
Very low casualties of American army in average modern war.
Very expensive education in the US which leaves only a few possibilities for the poor, especially those with below-average intellectual abilities.
Ability to escape local environment which may include very boring existence, inability to travel, unemployment, high crime rate and dangers associated with it.
Proof of their patriotism, especially, for non-whites, so that they could show it on occasion after the service so not to be harassed.
Also many people sign contracts with the military that they could be called in any time when necessary while continuing to live their usual lifestyles and earn some money for the contract. Many of them hope they will be never called, but this sometimes happens.
P.S. I am not American, this is just a look from out side.