But why does this not happen to planets themselves in relation to the sun?
I think the explanation is wrong: wikipedia offers a completely different explanation https://en.wikipedia.org/wiki/Tidal_locking.
Planets can become tidally locked to the sun- mercury is. Probably the timescale required for the other planets is just much longer
EDIT: Apparently mercury isn't actually tidally locked to the sun, TIL
Moons get tidally locked because they're very close to their planet, so the planet's gravity is by far the strongest influence.
The planets have much more complicated gravitational interactions because in addition to the Sun's gravity, they influence each other. So you end up with things like orbital resonances instead.
A planet that's close to its star and far from other strong gravitational influences will tidally lock to the star.