Why are military and civil aircraft landing gear generally so different?
There is no difference between civil and military aircraft. Not the least because the civil and military transport aircraft are actually the same models. Many military planes have civil variants like Lockheed C-130/L-100, other military planes are derived from civil ones, e.g. C-135 is B707.

The difference depends on where the wings and engines are placed. All the aircraft actually have similar clearance from the ground. Just on some the lowest point is fuselage, on others it's the engines hanging down from the wings and on propeller driven ones it is often the propellers.

Cargo planes (like C-130, C-5, An-124 or An-224) are often built with high wings, so the fuselage is lower and therefore easier to load. This is also concern for regional airliners as they are designed to carry their own stairs. That's why BAe146, ATR-42 or Dash-8 are high-wing and other like Bombardier CRJ series have tail-mounted engines so they can also be lower. On the other hand low or mid-wing designs with wing-mounted engines have better aerodynamic properties, which is why that construction prevails for large airlines.