Why is ram air not used for air conditioning in airplanes?
The problem is pressure. In order to use outside air for the cabin, it needs to be pressurized. Otherwise you could not reach higher pressures inside the cabin than outside.
The advantage of using bleed air is that this air is already pressurized, so you don't need to do any additional work. It is however too hot to be used as cabin air directly, so a PACK (Pneumatic Air Cycle Kit) is used to reach lower temperatures using ram air for cooling.
Ram air cannot be directly used without increasing its pressure. On the Boeing 787, which is equipped with bleed-less engines, the outside air therefore needs to be pressurized with electrically driven compressors:

In the no-bleed architecture, electrically driven
compressors provide the cabin pressurization
function, with fresh air brought onboard via
dedicated cabin air inlets. This approach is
significantly more efficient than the traditional
bleed system because it avoids excessive energy
extraction from engines with the associated
energy waste by pre-coolers and modulating
valves. There is no need to regulate down the
supplied compressed air. Instead, the compressed
air is produced by adjustable speed motor compressors at the required pressure without significant
energy waste. That results in significant improvements in engine fuel consumption.

(Boeing Aero Quarterly - 787 No-Bleed Systems, emphasis mine)
Note however that this compression also adds heat to the air, so the air still needs to go through a PACK before it can be used as cabin air:

In the 787 electrical architecture, the output of the
cabin pressurization compressors flows through
low-pressure air-conditioning packs for improved
efficiency. The adjustable speed feature of electrical motors will allow further optimization of
airplane energy usage by not requiring excessive
energy from the supplied compressed air and
later regulating it down through modulating valves
resulting in energy loss.
Avoiding the energy waste associated with
down regulation results in improvements in engine
fuel consumption, and the environmental-control
system air inflow can be adjusted in accordance
with the number of airplane occupants to achieve
the lowest energy waste while meeting the air-flow
requirements.

(Boeing Aero Quarterly - 787 No-Bleed Systems, emphasis mine)
You can see the inlet for the compressors and the ram air inlet in the following picture:

(image source)