Let $\tau\in Gal(M/K)$. Then it can be viewed as a $K$-embedding $M\to K_{alg}$. The theorem of extension of embeddings implies that there exists $\sigma:L\to K_{alg}$ such that $\sigma_M=\tau$ (you can use the fact that $L=K(\alpha)$ for some $\alpha\in L$
if you like). But $L/K$ is a Galois, hence normal, so the image of $\sigma$ is contained in $L$ and we have in fact $\sigma\in Gal(L/K)$.
Notice this is true even if $H$ is not normal.
There is no contradiction, because the equality $\sharp Gal(L/K)=\dfrac{[L:K]}{[L:M]}$ is false: ok, any $K$-automorphism of $M$ extends to a $K$-automorphism of $L$, but conversely, a $K$-automorphism of $L$ does not restrict necessarily to a $K$-automorphism of $M$, but only to a $K$-embedding. It would be true only if $H$ is normal!! So an element of $Gal(L/K)$ is not necessarily an extension of an element of $Gal(M/K)$, and you cannot count like you do.
For a specific example, think about $L=\mathbb{Q}(j,\sqrt[3]{2})$ and $M=\mathbb{Q}(\sqrt[3]{2})$. Take $\sigma:L\to L$ which sends $j$ to $j$ and $\sqrt[3]{2}$ to $j\sqrt[3]{2}$. Its restriction to $M$ is NOT a $\mathbb{Q}$-automorphism of $M$.