I'm going to link an article I read this week. It says why the gentleman involved fought:
He said he did it to be patriotic and to help. I guess that's the plainest and most honest answer you'll ever get.
I met a Navajo gentleman once who was a code talker in the Pacific in WWII--he and his brother both went and joined the military on December 8th, 1941. I asked him why he did it, and he gave me a funny look, and then said, "Missy, we had to. Those white men were going to muck things up!" Then he laughed, and said that in all honesty, they did it for the same reason every man volunteers--they feel it's their patriotic duty to help out in a time of crisis. (I live in Utah, so the Navajo Nation is in part of my state--other people may not have access to Native Americans, and especially to a group which was famous for their code talking contribution.) A book from a small, local press had just come out about the Navajo Code Talkers, and he had come in to see if we had it (I worked at the public library), because he was in it. Our copy was out, so I ordered one from another branch, and when it came in, I found his picture and his interview. He said pretty much the same thing he'd already told me. He became a code talker because he happened to be fluent in Navajo (his own brother and several of his friends weren't fluent enough to make the cut for the program), but he enlisted just because he wanted to serve, and to help his country. He was a patriot.
Remember that black Americans and Japanese Americans also served during WWII, and they did so with distinction. They were treated horribly, too. There was a very decorated Japanese unit that did all sorts of crazy stuff in Europe, and they were an all-volunteer unit, and some of them had family in detention camps here at home.
You ask why people who are treated so poorly in general would want to fight for the US. I think it's because when it comes to a decision like that, people look at it specifically. They don't say, "Here I am, a Native American (or today, a gay/Arab/American-but-not-a-citizen-yet/… whatever) person, one whose people have been treated like crap, and continue to be treated like crap, and now those same people who treat us like crap are involved in a war." They say, "Here I am, just me, Tom, and there's a war on, and I'm a little scared, but I want to help, so I'm going to volunteer." There's a world of difference when you move from the general to the specific. The general involves a lot of people--the specific involves yourself. And in the end, it's just yourself who volunteers and then goes off to risk your life.
I wish the US would show more gratitude to all those individuals, to anyone who has worn a uniform at any time. Our government tends to look at the generalities, and not the specifics. It's at the level of the specifics that things get complicated :(