The reason is the same as in the case of the continuity of the wave function.
In the case of piecewise continuous potential energy, in each interval of continuity of the potential, Qmechanic's argument applies (in a way, the bare fact that one can write the TISE trivially ensures the continuity of the first derivative as a consequence of the existence of the second derivative).
A little more subtle is the condition at the points where the potential energy is discontinuous. In principle, left and right derivatives exist but may differ. Even wave function values could be different (remember that the only requirements are that wavefunctions must be square-integrable and piecewise solutions of the TISO. Conditions compatible with discontinuous wavefunctions).
However, the Hamiltonian must be a self-adjoint operator, and the solution of the piecewise continuous TISO we are looking for must be an element of the domain ensuring self-adjoinedness. This requirement forces the continuity condition on wave functions and their first derivatives.
Indeed, a self-adjoined operator must be symmetric (conjugate-symmetric on a complex vector space), i.e.
$$
\langle f,Hg \rangle = \langle g,Hf \rangle
$$
for every functions $f$ and $G$ in the domain of $H$.
Let's assume, for simplicity, that there is only one discontinuity in the potential energy at $x=0$. This is the only point where functions and derivatives may have different right and left limits. However, working with the matrix elements of the kinetic energy operator, we would have (after a twofold integration by parts)
$$
\langle f,g'' \rangle = \langle g,f'' \rangle + f(0^-)\Delta g' +g'(0^+) \Delta f + f'(0^+)\Delta g+ g(0^-) \Delta f'.
$$
If the condition of symmetry should hold for any value of $f(0^-), f(0^+), g(0^-), g(0^+)$ the domain where $H$ is symmetric is made by continuous functions with a continuous first-derivative.