Why does there need to be an isothermal compression in a Carnot cycle?

Because what you propose is impossible. You are essentially trying to make a cycle out of only these three steps:

1) Isothermal expansion (A to B)

2) Adiabatic expansion (B to C)

3) Adiabatic compression back to original state (C to A)

The curve going from C to A cannot be an adiabatic process. Adiabatic processes are characterized by $$PV^n=\text{const}$$ where $n$ is a property of the gas being used.

Therefore, if you want to follow an adiabatic curve during compression, you will just end up going back to state B. You can't go to state A from C using an adiabatic compression.

This is why we need the isothermal compression step after the adiabatic expansion step. This step is needed so that we can get on the correct adiabatic curve back to state A


To be a little more specific, let's say the pressure and volume at states $B$ and $C$ are $(P_B,V_B)$ and $(P_C,V_C)$ respectively. Then we know in process 2 $$P_BV_B^n=P_CV_C^n=\alpha$$ Or, in other words, the entire curve is described by $$P=\frac{\alpha}{V^n}=\frac{P_BV_B^n}{V^n}=\frac{P_CV_C^n}{V^n}$$ Now we want to do adiabatic compression from state C. Well we have to follow the curve defined by $PV^n=\beta$, but since we know we start in state $C$ it must be that the constant is the same one as before: $\beta=\alpha=P_CV_C^n$. Therefore, the curve is given by $$P=\frac{\beta}{V^n}=\frac{P_CV_C^n}{V^n}$$ which is the same curve we followed going from B to C.

We need the isothermal compression step in order to get to the appropriate state D such that $P_DV_D^n=P_AV_A^n$


Examine the problem in the $T$-$S$ plane

It is traditional for books to diagram the Carnot cycle in the $P$-$V$ plane (it's also useful because the enclosed area is the net work on a cycle).

It is much less common to diagram it in the $T$-$S$ plane (even though it's just as useful because that enclosed area is the net heat). I suspect that the main reason that diagram is rarely shown explicitly is that it is a boring diagram: it's an axis-aligned rectangle.

Think about that for a minute.

If we do one adiabatic stage (vertical movement in the $T$-$S$ plane) and one isothermal stage (horizontal movement), then there is no adiabatic path back to the starting point because adiabatic paths are vertical.

And this fact is independent of the equation of state of the working fluid: it only relies on the assumption that you are executing adiabatic and isothermal stages.