The folks in defense procurement do not read Voltaire. As a result, the do not know that the best is the enemy of the good.
The XM-8 was a new and improved M-16 assault rifle (it also would have replaced the M-4 carbine). The main selling points were that it was a little lighter and much more reliable, even in adverse conditions for a similar cost. It wasn't going to be terribly expensive. For the cost of 7 F-22s or one new destroyer, they could have been made available to every single Marine and Army solider. Please recall, the Marines and the Army are currently fighting two regional wars and seeing troops killed every day. Neither the Navy nor the Air Force are making this kind of sacrifice. This program has now been cancelled, however (full text here of the government's announcement in Word format). So despite having an improved version of something we already have which is immediately ready to field test, the military is simply going to abandon the whole enterprise and start over from scratch in the hope of someday, many years from now, finding something better. You know what they say about military intelligence.