Others have stated some of the big reasons why service members get so much respect: they risk their lives for their country, they give up some of their Constitutional rights (although they also gain some extra rights, such as Article 31 rights), and they generally accept lower compensation than they might get on the outside (still true, but not nearly as true as it used to be). I would add another reason: they accept the burden of spending many years of their lives away from home, often missing major life events (weddings, graduations, even the births of their own children), as well as the lesser burden of having to move every 2-3 years.

However, there's another side to your question: why is the U.S. like this, and not other countries?

My initial response would be to turn that around: why don't people in other countries hold military service to a higher level of respect, especially considering that some of the reasons given here for respecting the military (e.g. giving up rights or accepting lower pay) are more applicable in some other countries? Just because the U.S. is unique in this regard, doesn't mean we're the ones doing it wrong. There have been others who felt their nations didn't give their troops enough respect:
http://www.web-books.com/Classics/Poetry/Anthology/Kipling/T...

That being said, I think that there are some important differences in U.S. culture that help to explain the difference. One thing relatively unique about the U.S. is that, unlike most nations, we do not have an ethnic identity. For example, Spaniards can feel united in the fact that they are all Spaniards, the Japanese can feel united in the fact that they are all Japanese, etc. Certainly there are ethnic sub-groups within most countries, but for the most part they have a national identity that is rooted in their shared ancestry, and of a shared history that in almost all cases predates the existing government by centuries. Since the U.S. lacks that, we have a national identity rooted in ideals, embodied specifically in the Constitution. There is certainly a great deal of political disagreement about the specifics of those ideals (and of the meaning of the Constitution), but the generalities are largely agreed upon.

So what does this have to do with the regard in which we hold military service? Well, part of it is an awareness, dating back to our war of independence, that our Constitutionally guaranteed rights were underwritten by a lot of individuals who left their homes to fight for those shared ideals which define us. We literally would never have come to exist as a nation if it were not for our military services.

We also have an ideal in this country of "Citizen Soldiers." It is not unique to the U.S. (I believe it originated in ancient Greece, but please correct me if I'm wrong), but I think that the only nations that currently subscribe strongly to this idea are the U.S. and Israel. It's the idea that our military consists primarily of individuals who are not lifelong military professionals: most of the people in our military serve for only a few years, then go back to being ordinary Americans. This means that we have a lot of veterans spread throughout our society, so that almost everyone knows at least one veteran, raising cultural awareness of military life. Conversely, in a nation where the military consists primarily of individuals who make a lifelong career of it, the military tends to be a little less visible to the bulk of the population because they don't have as many veterans to interact with. There are quite a few nations with universal conscription (everybody has to serve for a few years), but with the exception of Israel, I haven't seen this same "citizen soldier" meme in such nations. I think there are two reasons for this. First, the time spent is very short (usually 2-3 years, as opposed to the minimum enlistment in the U.S., which is 4-5 years) and at the end of that time the choice is "get out, or commit to a life-long career," as opposed to the U.S. military, which allows a succession of short re-enlistments. The second reason is most important: in countries with universal conscription, it's just seen as something everyone has to go through, like high school, and the conscripts are not fully integrated into the military: they are given minimal combat training and are used primarily for drudgework, with more thorough combat training coming only after an individual commits to a professional military career.

Finally, I can't end without addressing this:

>America's wars post WW2 are mostly invasions of random third world countries against underequipped,and mostly untrained enemies, and even then the victory/defeat ratio is very mixed.

Our two biggest wars since WWII were Korea and Vietnam. The Korean war was really a war fought against China on Korean soil. The People's Army is hardly something to sneeze at. The NVA was also a modern army, equipped and trained by the Soviets and the Chinese. Our next-biggest war (and longest, by far) was Iraq, which showed that "underequipped, and mostly untrained enemies" can be quite deadly.

This statement also seems to imply that we should judge the merits of military service on the basis of our political views about the particular wars fought, and on the degree of success achieved. In reality, we judge the merits of military service on the basis that these individuals volunteered to make tremendous sacrifices in service to a noble ideal: our Constitution, and the concept it embodies (a self-governed people).