Although it is possible to play the harmonica totally by ear, you can get a lot further by learning to read and understand written music. Since it is the brain which issues the information for playing, it is most important to train the brain to recognise sounds and to build up a bank of knowledge which makes it easier to understand the whole process of making music.
This has the added benefit of helping you to relate to what other musicians are playing and understanding the way a song’s melody and its accompaniment work together, as well as making it easier to understand the sheet music of any song you wish to learn.