Typically the only people I hear suggesting electric keyboards over a piano for music lessons are those who don’t play piano. Conversely, I have yet to hear one of the same people suggest they get a keyboard for flute lessons or string lessons. Even accordions which can be built with a keyboard component are never recommended to get a keyboard over the instrument they are learning.
So why would an electric keyboard be able to replace a piano?
Yes, they look very similar in the business end of the instrument but this is merely a result of creating a useful interface for musicians, Moog had tried other designs which were not satisfactory when building synthesizers (the precursor to electronic keyboards).
As I hinted above, the keyboard can produce a piano like sound, but it can also produce other instrument-like sounds but they are forever inferior to the real instruments they imitate.
How is a keyboard not a piano?
When you develop your skills as a pianist you begin to notice the beautiful nuances and subtle differences in musical styles. You also learn how to manipulate the piano in such a way that you can juxtapose sweet and somber music with jovial, dancing brilliance, and from there even move into an angry, dark scolding tone. All without changing anything more than the way your fingers interact with the ebony and ivory.
A major factor in this agility are the physical properties of the hammers. The sound quality produced from different strike intensities varies due to the hardness in certain parts of the hammer. A light blow and produce a soft, gentle sound, not simply quieter- which is the result of a soft blow on an electronic keyboard. A harder blow brings out brilliance found deeper in the more dense portions of the felt hammers.
But there is even more you can do with the piano. The timbral quality of playing with different depths and force on they key stroke can vary your music. Instead of playing the key all the way down, until it stops, you can manipulate it nimbly as though your finger is slipping across a street in the rain dodging puddles, already off the key as the note sounds. You can play with very heavy fingers so that you hear the sound of the key getting to the bottom of its motion before the note fully forms in the air.
An electronic keyboard is going to give you a nice piano sound but will only allow you to play with the volume as a performance variable.
Another major difference between these instruments are the strings. In a piano, the strings resonate sympathetically. The highest octave and a half have no dampers. The result of this is such that when you play a note or chords in lower octaves, their corresponding parts ring and support their counterparts. The most prevalent sympathies are the octaves and fifths, but other notes chime in as well. Many pianos allow the “non-speaking-length” to ring coincidentally in the aliquot. This creates a more robust sound in acoustic pianos.
This same principal is at work when the dampers are raised from all the strings using the pedal. Electronic keyboards will sustain a played note but not compliment it with the sympathetic parts given by the other strings.
This article is not to say that keyboards are bad but simply that they are not pianos. Each has their uses, but if you want to learn piano then you should learn piano. Not piano sound. Otherwise we might as well teach flute by means of “flute sound” on a keyboard.