Why do military aircraft use a different kind of aviation fuel?
Military aircraft can and do fill up on civil Jet-A -- this is common at facilities where the extra expense of providing both Jet-A and JP-5 or JP-8 fuel isn't worthwhile.  However, the military jet fuel types do provide some advantages over Jet-A:


JP-5 has a high flash point, improving its handling properties over civilian jet fuels.  This is important for fire safety in the close confines of an aircraft carrier.
JP-8 is similar to civil jet fuel, but also has extra thermal stability additives in it.  This allows for longer-term storage under harsh field conditions, and better resistance to deposit formation in places like afterburners and fueldraulic movable nozzles where the fuel is exposed to high temperatures even before it's burned.  It also may be specified for properties such as cetane rating that are essential for proper performance of diesel reciprocating engines run from JP-8.


(I'm omitting JP-4 from this discussion as it's a wide-cut fuel, comparable to civil Jet-B, and was retired from USAF service in 1995.)