Why do airplanes use an axial flow jet engine instead of a more compact centrifugal jet engine?
Centrifugal compressors only produce a more compact engine at low mass flow, which means low thrust.

The amount of thrust an engine can produce is proportional to its intake area times exhaust velocity. Increasing the latter is undesirable, as energy and thus fuel consumption is proportional to velocity squared. So engine designers target mass flow to gain more thrust, not more velocity.

Since they are 3D structures, in a basic solid design (that you'd find in early jets and small modern turbines), the volume of a centrifugal compressor grows in cubic proportion to its diameter, while frontal area, which limits its mass flow and thus its thrust, increases only as diameter squared. This creates a cube-square law.

Large real-life parts are filled with lightening and cooling channels, so the mass-to-area law is more complex. Still, it cannot eliminate the volume effect entirely. The end result is that the mass of centrifugal compressors grows considerably faster than their mass flow. 

At the highest power levels, centrifugal compressors become prohibitively heavy even for fixed powerplant machinery, where durability otherwise trumps weight, so the largest base load powerplants run all-axial. With axial compressors, the flat design with a short air flow path allows mass to only grow in direct proportion to mass flow, and very powerful engines can be built within reasonable dimensions.

It's not pure cube-square law in either case, but it's something like k1*massflow^[2.5, 2.8] for centrifugal versus k2*massflow^[2.2, 2.4] for axial, where k2>k1, giving centrifugal compressors some advantage in small sizes. Centrifugals are also much cheaper to produce (at least small ones).

High-performance engines, such as those in commercial aircraft, also need to pack more thrust into the smallest cross-section they can, while maintaining efficiency, so as to reduce drag and also fit under the wings, enabling heavier jets. Axial compressors offer a lot more intake area for any given cross-section - thus more thrust. 

The smallest jets, where thrust requirements are small and the engine's cross-section is very small compared to the fuselage, can afford the extra diameter of a centrifugal or diagonal flow compressor. Yes, it's the same cube-square law (also reduced somewhat in practice) that keeps the engine cross-section to total cross-section ratio increasing as aircraft go up in size. Small centrifugal compressors are simpler, easier to build, and more robust than small axial ones.

So in every industry, as power grows, there is a crossover point from centrifugal to axial. For aircraft where drag is critical, it's just above small bizjets, mobile ground and helicopter turbines stay centrifugal or mixed up to a few MW, and in the tens of megawatts even fixed powerplants switch from axial/centrifugal to all-axial. 

Engines close to that crossover point typically combine axial and centrifugal stages. Newer diagonal compressors are in-between and quite good, offering an even more tailored compromise.