The ToS prohibits selling of in game items, not buying. Yes the market exists because there is a demand and reducing the demand would naturally limit the supply... but Blizzard for some reason has not deemed this an appropriate strategy. *Supposedly* accounts get flagged when transferring in excess of 5000 gold, but that may just be a rumor.
Regardless, there would be no way for Blizzard to ever prove you paid RL currency for gold unless they sued the gold seller, got a subpoena, and found a copy of the transaction including your name, your character's name, and your credit card info. For all they can prove, it was just a benevolent chinese farmer sending random people bundles of gold.
Now of course that sounds rather ridiculous but it is the reason that Blizzard seeks to shut down the sellers. However, even then they are limited in their options. They can pretty much only shut down those accounts that are using 3rd party programs (i.e. bots) or those that are being shared by multiple individuals (in which case you would need multiple IPs... which is unlikely on a sharded computer).
There is no easy solution for Blizzard, as obvious as it may seem. Remember Blizzard is a business and has to operate within certain legal restrictions; they can't ban people on a hunch that they must have bought any large amount of gold sent to them.
And as to why people buy gold? I'd say three types of people off the top of my head:
1. The Casual - Either they just started the game or just don't play much. They want the best BoE's but don't want to spend the time to grind for the gold. They just like to hop on and dink around for a little while and don't want to spend their limited time farming when they can have that item now! This person is the most likely waste gold over and over as they buy BoE epics on their road from 1-60, forgetting that low level BoE's are quickly replaced.
2. The PVPer - Caught up in the unrelenting PVP grind, this person needs gold for repairs, pots, and the items they earn. Unfortunately being trapped in a battleground all day leaves them no time to farm. They buy gold to prop up their income-less PVP grind.
3. The Raider - The hardcore raider. When he's online, he is raiding. Between real life and the rigors of an intense raiding schedule, he has virtually no time to farm for gold. Unfortunately, high end raid encounters demand high repair costs and numberous consumables. When it comes down to skipping raids to farm for gold or just buying it, the latter is often the choice.