Why can I hear you through a wall but cannot see you through a wall? Why does my radio work indoors, even though the view of the transmitter is blocked? Simply, both light and sound are waves; why does light get blocked by a wall, but sound does not?
The answer has to do with the wavelength of the wave relative to the medium through which the wave is traveling. An analogy is that a person running through a rainstorm will get from point A to point B. However, a small insect will get knocked down by the rain.
In this analogy, the rain is the wall, the person is the sound wave and the insect is the light wave. Sound and radio waves have very long wavelengths compared to the size of the atoms that make up the wall. On the other hand, light has a wavelength that is about the same size as the atoms that make up the wall, and are, therefore, blocked by the wall.
This explanation also works for why high-frequency (5 GHz) WiFi waves are blocked by walls to a greater degree than lower-frequency (2.4 GHz) WiFi waves. In addition, this explanation completely ignores the chemical structure of the medium. For example, not all walls block light — a glass wall will allow light to pass. Similarly, radio waves cannot pass easily through a lead barrier. These differences are caused by the electron structure of the medium interacting differently with different types of waves.