I think it's mostly a practical matter of efficiency. Think about how many sounds are being played at once during a 25-player raid boss encounter. You've got the boss using abilities; the boss getting hit by abilities; adds using abilities, adds getting hit; 25 players using abilities and getting hit by the boss, adds, fires, void zones, and who knows what else; procs going off; pets using abilities and getting hit; fires and void zones and such spawning and making noise; environmental stuff like torches, flowing and falling water, dropping rocks, etc. That's a
lot of sounds.
If you were to turn that over to the UI, not only would you be slowing things down by shifting the work from the game's C code to the much slower Lua environment, but you'd also have to slow it down even more by telling the UI about all of those hundreds or thousands of things that require sounds. While the UI is aware of some of those actions -- for example, the UI knows when you cast Fireball, and it knows when the boss dodges a melee hit -- it isn't aware of many others -- for example, the UI doesn't know when a void zone spawns under you, so it
couldn't play a sound to warn you about it until you actually took damage from it, and it
definitely doesn't know about torches and waterfalls and other environmental stuff that makes noise.
However, there is a "security" aspect, too. Currently, all of those sounds are rendered as part of the 3D world -- when you hear the sound of a melee hit getting blocked, for example, you can tell whether that's happening off to your left or your right, and you can tell whether it's right in front of you or further away. If you were playing all of those sounds through the UI instead, you wouldn't be able to have that positional info, because the UI doesn't have access to the locations of things in the 3D world, by design; Blizzard doesn't want addons to be able to tell you that your arena enemy is 12 yards forward and 17 yards left, or even that there is a void zone 2 yards to your right. Even if the UI was only told "play this sound, at this volume, with this channel balance" you could still use that information to estimate other information that Blizzard doesn't want you to have, and there's not really any way to avoid that issue as long as the information is available to the UI.
On a less tangential note, you may have better luck simply extracting all the spell sounds from Data/sound.MPQ using
MPQEditor and playing through them in your regular music player, than by copying and pasting thousands of in-game PlaySoundFile commands.