Proof (tower of algebraic extensions)
$M/K$ is algebraic $\implies$ $L/K$ and $M/L$ are algebraic
Every element of $M$ is algebraic over $K$, meaning that it satisfies a polynomial over $K$, thus a polynomial over $L$, so $M/L$ is algebraic. Also since $L\subseteq M$, $L$ is algebraic over $K$.
$M/L$ and $L/K$ are algebraic $\implies$ $M/K$ is algebraic
Let $α\in M$. Since $α$ is algebraic over $L$, it is a root of some polynomial $f(X) = a_d X^d + \ldots + a_1 X + a_0 \in L[X]$. Consider $$ \begin{align*} L' = K(a_0, a_1, \ldots, a_d). \end{align*} $$ Then still $f\in L'[X]$. Therefore $α$ is algebraic over $L'$ and so $[L'(α) : L'] < \infty$.
$a_0, \ldots, a_d$ are algebraic over $K$, so $[L':K] < \infty$. Thus by the tower law, $[L'(α) : K] < \infty$. But $K(α) \subseteq L'(α)$, so $[K(α) : K]<\infty$. Hence $α$ is algebraic over $K$.