Why does sound not move through a wall? I'm learning a bit about sound and was wondering:
If the speed of sound is determined by the amount of matter the source is surrounded with, why doesn't it go through a wall?
Example:
Speed of sound in air is 343 m/s but in water, it moves at 1500 m/s because of the increase of matter surrounding it. And since iron has more tightly packed matter, it moves even faster because it's moving the matter to move the vibrations.
If this is true, why doesn't the sound go through walls? Is it because it loses its "strength" for the amount it travels? 
 A: Sound doesn't go through walls? Please tell my neighbor.
In electromagnetism, a medium has a property called an "impedance" which is related to the index of refraction and the speed of waves in the medium.  At an interface between two media, the relative impedances determine how much of an incoming wave is transmitted or reflected, so that the entire power of the incoming wave goes somewhere. At an "impedance-matched" interface the reflection coefficient goes to zero.  In signal cables and waveguides for electromagnetic waves this leads to people adding "terminating resistors" in various places, so that an incoming signal doesn't get reflected back from a cable junction.  Conversely, at a junction with an impedance mis-match, the reflection coefficient is generally nonzero and not all of the power is transmitted.
You can do the same sort of analysis for sound waves moving from one medium to another.  The reflection and transmission coefficients can depend on the frequency of the wave, as well, which is why my neighbor complains when I have my music turned up too loud: they can hear the low-frequency bass sounds just fine through the wall, but the high-frequency components (that they'd need to follow the lyrics) don't reach them.
A: Sound waves are just pressure oscillations; when they strike a surface they are either reflected, transmitted, or absorbed. When they're transmitted, you'll hear them on the other side.
According to Wikipedia, regarding acoustic absorption:

Deformation causes mechanical losses via conversion of part of the sound energy into heat, resulting in acoustic attenuation, mostly due to the wall's viscosity.
The fraction of sound absorbed is governed by the acoustic impedances of both media and is a function of frequency and the incident angle.
In general, soft, pliable, or porous materials (like cloths) serve as good acoustic insulators - absorbing most sound, whereas dense, hard, impenetrable materials (such as metals) reflect most.

So, walls will reflect the sound waves, as well as absorb them. The effectiveness of this depends on the material properties of the wall, as well as the frequency of the sound (low frequencies travel much easier through plywood, for instance).
A: It does.
There's an important concept in soundproofing called flanking noise.  There are various sources, but the most common is having sound transmitted through some kind of solid structure (walls, roof struts, door and window frames, etc.) into the soundproofed area.  This is a major problem for soundproofing, and it's one of the hardest problems to solve because it's hard to completely isolate a room from its surroundings.
It also leads to interesting problems in multiple-occupancy buildings.  A friend of mine used to live in a row of new-build terraced houses which had been constructed with continuous supporting girders running between houses (instead of having solid "bulkhead" walls between them, as usual for older terraced houses).  The result was that a noisy neighbour at the opposite end of the row could still be heard clearly in my friend's house.  Many flats have similar problems, with sound transmitted through the concrete structure.  Any dense, rigid material transmits sound reasonably effectively.
Although these dense, rigid materials are good at transmitting sound along themselves from one end to the other, they're not so good at broadcasting the sound in air.  For us to hear it, either we have to be close to or touching the structure itself, or the structure has to cause the air to vibrate.  A flat brick wall isn't very good at vibrating, although of course it will do to some extent  However, attach plasterboard (rockwall) to that wall and your plasterboard becomes a "sounding board" in the same way as the top of a guitar.  Your bed frame can do the same, which is why you can hear building-transmitted sounds more clearly when lying in bed.
If you want to stop this happening, it's fairly achievable.  The flat brick wall isn't great at putting energy into the air.  If your plasterboard wall is not physically connected to the brick wall it's in front of, the sound has to be transmitted into the air in the gap between, into the plasterboard, and back into the air on the other side.  Each step is inefficient, so you end up with a quieter room.
Don't forget the flanking noise though.  Whilst you've stopped sound coming through the wall, sound also goes up the wall to the ceiling and down the wall to the floor - and your plasterboard wall inside has to be fixed to something, right?  So the sound gets in that way instead.  Not so much, but still plenty enough to be significant.
A properly acoustically-isolated room therefore doesn't attach to anything.  The isolated room is constructed as an isolated box, with no connections to the outside on the walls or ceiling.  There are separate inner-room and outer-room doors with a vestibule between, so sound can't get through the door frames.  And on the floor, the box sits on some kind of sprung supports (neoprene rubber for cheaper, smaller builds, or car springs for large professional installations) which transmit as little sound from the outer-room floor to the inner-room floor as possible.
