What is the evolutionary purpose of the topology of human ears? I understand why the ears may have a funnel-like shape but if the various "hills and valleys" do not amplify incoming sound, what purpose do they have?
Humans do not have the ability to move their outer ear in response to sound. Many animals can do that, and use it to determine the source of the sound waves. Thus, human outer ears are equipped with many "hills and valleys". It does not provide amplification (because the waves can lose their energy bouncing around the ridges), but rather gives the brain more information about the sources' location in space. The brain calculates that location by determining minute differences in the time it takes for the sound to reach sensory cells in the inner ear on both sides. The shape basically attenuates the raw information. That way you get different properties of the sound wave that enters your ear depending on the angle at which it fell on you outer ear.
Humans can localize the horizontal location of sound ("azimuth") using temporal cues (sound reaches the 'closer' ear first') and level (the head blocks some sound so it louder at the 'closer' eat) cues, depending on frequency.
For detecting the "height" or "elevation" of a sound, other cues are necessary. "Pinna cues" refer to a pattern of level distortions at different frequencies that, combined with predictable elements of natural sound (such as harmonics), allow the listener to determine elevation. The head also contributes, so these cues are grouped together as a "Head Related Transfer Function." Importantly, the two ears are never perfectly the same, so these cues can be differentiated from the azimuth cues I described earlier. One can measure these pinna cues by placing a microphone in the auditory canal.
The Wikipedia article on sound localization has some more information, as do several online course postings and textbooks, for example this one, or by searching for terms like "sound localization elevation pinna".
One possible advantage is that's it's probably the best adapted to being able to hear a very low volume source of sound no matter which direction it's coming from. A horse ear on the other hand, is probably the best adapted to being able to hear an even lower volume source in only a very narrow range of directions. One reason for being able to hear well in any direction is to avoid predators. Maybe in our evolutionary history, we sometimes went into a jungle and there was a dinofelis lurking in it with silencers on its feet and we couldn't see it so we evolved ear the shape we did so that we could hear it from really far away if it started walking no matter which direction it was from us and prepare to fend it off with spears. Maybe we always had ears the shape we do then we just started evolving to have horse like ears so that we could keep moving our ears until we locate the dinofelis and then in response to that, the dinofelis evoled to stop walking a very short time after it starts when it's in the jungle so that we can't hear it from further away anymore so it became advantageous to hear as far as we can in any direction so we stopped further evolving horse like ears and that's why some people can move their ears a tiny bit. One reason for being able to hear such a low volume source in any direction is to catch prey. Deers probably evolved ears shaped the way they are so that they could keep turning them until they hear a prey animal and then keep their ears pointed towards it so that they can keep hearing it so that they can hunt it.
Evolution doesn't have a purpose. In that light, it's quite possible for an ear to be poorly adapted to hearing - which in fact it is compared to other species.
Stereo hearing (two ears, so you can better detect where the sound is coming from) is heritage from our ancestors, and I know for a fact it didn't evolve further in humans because there was no evolutionary pressure.
In any case, the topology isn't exclusive to our species and is heritage from our mammalian lineage. At some point in our lineage, the species/individuals who had this topology of the ear were able to gather sound waves better and that affected their survival so they passed on the trait to their offspring. Ear topology didn't evolve in humans.