It was not invented by the military although they are a major user of it. It comes from international agreements on "Coordinated Universal Time" which is measured in Greenwich, England and known also as Greenwich Mean Time. I have stood along the Prime Meridian Line outside the Greenwich Observatory.
It used a 24 hour clock without having the ability to add "AM" or "PM" at the end of the number so they used 24 hours instead. One PM becomes 1300 hours. There is less confusion as to whether someone meant 6:00 am or 6:00pm if you call just one of those 6:00 and the other 18:00. The US is one of only a few countries who still use the AM PM thing. http://en.wikipedia.org/wiki/24-hour_clock
So no, it is not because of military influence that you see it but more due to international conventions.