WHY DO STARS TWINKLE?
Though it wouldn’t work so well in the nursery rhyme, a there is actually a technical term for when stars twinkle: astronomical scintillation, an effect due to our planet’s atmosphere. As light travels through the blanket of air around our planet, it is diffracted (bounced around) causing a quick apparent dimming and brightening — a star's signature "twinkle".
While some stars do physically change in brightness over time, they typically do so on long timescales — amateur astronomers monitor these changes sometimes over hours, but more often over days, weeks, or years. These variable stars are well studied and often signal complex physical changes happening to the stars in question.
The more rapid changes of scintillation, on the other hand, come about long after the light has left the star. Light waves traveling through Earth’s atmosphere diffract as they pass through pockets of air at different temperatures. Because the light waves come from a single point, this effect can make the star’s brightness and/or position appear to change.
WHY DON'T PLANETS TWINKLE TOO?
Unlike stars, planets don't twinkle. Stars are so distant that they appear as pinpoints of light in the night sky, even when viewed through a telescope. Because all the light is coming from a single point, its path is highly susceptible to atmospheric interference (i.e. their light is easily diffracted).
The much closer planets appear instead as tiny disks in the sky (a distinction more easily discerned with a telescope than with the naked eye). Their apparent sizes are usually larger than the pockets of air that would distort their light, so the diffractions cancel out and the effects of astronomical scintillation are negligible.