What does Minecraft's scary music mean?

Solution 1:

As described in this article on minecraftwiki.net,

Ambience (sometimes called cave noises) is a set of sounds that occasionally plays when the player is in close proximity to an unlit cave. Despite their name, they are not sounds that one would expect to hear inside of a cave, such as falling pebbles, but rather supernatural noises frequently likened to ghostly train whistles, rice rockets, and demon roars.

Ambient sounds require that a space at least 3×3×3, entirely at light level zero, be positioned ten to twenty blocks away from the player in any direction. The space does not need to be sealed off - a sound can even play from a space that the player can actually see - nor does the player need to be underground to hear it. The sounds can also come from player-created spaces, even if that space is a box above the clouds.

Contrary to popular insistence, ambience is not an indicator of nearby ore, dungeons, or mobs. Following them can still lead the player to such things indirectly, since they emanate from unexplored caves.

Solution 2:

I don't think it means anything significant, definitely not that there's a dungeon around.

I have noticed that I tend to hear it as I descend into darkness or reach the surface during the day, so I believe that there are triggers to improve the mood, just not ones that are related to dungeons (yet).

Solution 3:

I've heard it when entering a dark area when I'm caving before put torches up. This has happened regularly enough to make me think it is a trigger for the scary music, but may be just a coincidence.