Why do military turbofan engines use a low bypass ratio?
It's not military vs civilian, but subsonic vs supersonic-capable

Note that subsonic military aircraft use the same engines as civilian aircraft, even if their names might be different.


The KC-135 used initially the J-57 which was called JT-3C when used in the Boeing 707-120. Now they fly the CFM-56, which is used on the Boeing 737 and the A320.
The C-5 Galaxy uses the GE TF39 which became the CF6 when mounted to a Boeing 747-100 or a DC-10.
The Fairchild A-10 uses the GE TF34 which is called CF34 when mounted to civilian aircraft like the Bombardier Challenger.


No, the differences arise only when the aircraft is designed to fly supersonic. This requires a very different approach to the integration of the engine:


Supersonic aircraft engines are mounted close to the centerline. If possible, they are straight behind the intakes, so the intake flow does not need to change direction. Exceptions like the SR-71 are rare.
Supersonic intakes are longer and have sharp edges as opposed to the short, blunt intakes of subsonic aircraft. Also, most have a variable geometry to adapt to the very different flow conditions at supersonic speed.
Since it is the job of an intake to slow down the air going into the engine, supersonic intakes cannot have a big capture area, or their spill drag in supersonic flight would be excessive. Supersonic engines need to create their thrust with much less airmass than purely subsonic engines. Forget stealth, this is the real reason for the smaller diameters of supersonic-capable engines.
The nozzle of a supersonic aircraft is also variable, in contrast to the fixed nozzle of subsonic aircraft. This again helps to adjust it to the flow conditions, but in this case the major difference is between reheat on and off. Afterburning engines are capable of much higher exit speeds to compensate for their smaller diameter. They accelerate less air to a higher speed to create comparable thrust.
The last point mentioned it, but it deserves a bullet of its own: Supersonic engines use afterburners in order to have enough thrust for going supersonic at all. The hot exhaust gasses have a much bigger volume than the cold intake flow which needs to be accommodated by widening the nozzle.


Note that the civilian Concorde used also a variable intake and nozzle and afterburners. It had an engine which was used on the BAC TSR-2 before, a supersonic military aircraft.

The real distinction is not between civilian and military, but between purely subsonic and supersonic-capable. Initially, both was achieved with the same engines. The J-57 mentioned above was also used on the supersonic F-100 military jet. Only in the 1960s did those lines diverge, and the subsonic aircraft grew ever bigger low-pressure compressor stages. These were again driven by the high-pressure cores which were used on supersonic aircraft.

Background

Thrust is air mass flow multiplied by the speed difference between flight and nozzle speed of the engine. To increase thrust, subsonic engines try to maximize mass flow (by increasing the bypass ratio) while supersonic engines rely more on increasing the nozzle speed (by using afterburners). Since net thrust is only possible when exit speeds are higher than the flight speed, the engine's exit speed needs to increase with the design flight speed.

The core engines do not differ much - after all, the intake will make sure that air reaches the engine at a speed of Mach 0.4 to 0.5, regardless of flight speed. The core of the General Electric F110 (installed in the F-15 and F-16 fighters, among others) became the core of the CFM-56 turbofan which is used in the Boeing 737 or the Airbus A320. The main difference is in their bypass ratio. The slower the design speed, the bigger the bypass ratio may become. At very low speed, the ungeared, shrouded fan is exchanged for a geared, free spinning propeller, in other words, the jet changes to a turboprop. The intake and nozzle, however, are very different indeed.

The optimum bypass ratio changes continuously, but since the drag coefficient drops after crossing Mach 1, airplanes are either designed for a maximum Mach number of 0.9 or less, or 1.6 and above. The corresponding bypass ratios today are up to 12 for subsonic engines, and less than 1 for supersonic engines. This produces a sharp boundary at the speed of sound, and many military engines designed for supersonic flight lost their afterburners and were fitted with a big fan to become the engines for subsonic transport aircraft.

The differences between sub- and supersonic engines grow bigger the more you move away from their core. High-pressure compressor, combustion chamber and high pressure turbine look and work the same, but the low pressure compressor of subsonic engines swallows a lot more air and has a much bigger diameter. Supersonic engines in turn mostly have an afterburner. The biggest difference, however, are the intakes (large pitot intake with blunt lips for subsonic aircraft versus adjustable spike or ramp intakes for supersonic flight) and the nozzle (fixed for subsonic flight versus a complex, adjustable convergent-divergent nozzle for supersonic flight). This is due to the very different air speeds and the much higher exit velocities required for supersonic flight.



Look at the intake section of the XB-70 pictured above (source). The capture area is rather small, and then the intake tube widens to enable the slowing of the airflow. The inclined sidewalls of the intake section cause a lot of drag at Mach 3. Now think the six GE YJ-93s are replaced by engines with an even bigger diameter. The increase in wave drag due to the even blunter intake would cancel out all advantages of a higher bypass ratio.

What is less obvious is the fact that this intake section also creates maybe half of the overall thrust of the propulsion system. But this answer is already too long, so I save this for another answer.