8kHz is the traditional sampling rate, but the audio bandwidth is less. As others have described, firstly the the sampling rate has to be at least twice the audio bandwidth, and secondly, filters to prevent the input frequency exceeding do not provide an instant cut off. That wasn’t close to physically realisable in the past, when such filters would have delayed the audio a lot, and unevenly.
The actual traditional audio bearer capability is 3.1kHz audio, those 3.1kHz being between 300Hz and 3.4kHz. That got locked down by the 4kHz channel spacing used in frequency division multiplexed systems, and the practically realisable filters for those. Keeping the same audio bandwidth resulted 8kHz sampling being a sensible rate.
There is a move to providing a 7kHz audio service (16kHz sampling) as the PSTN moves to VoIP and mobile phone networks are doing the same, for all but 2G.
Mobile networks further complicate the quality issue, in that they generally don’t provide a 3.1kHz audio service but rather a speech service, which means they use codecs that make assumptions about the human voice, which allows lower bit rates, but limits their ability to carry music, or inband DTMF.
Asterisk is not limited to 8kHz sampling, and nor are most IP phones. If you choose codecs with faster sampling rates, the lowest common denominator will get used by Asterisk.
Traditional digital phone systems also have a limited dynamic range, as they only use 8 bits per sample, but coded somewhat logarithmically, so that they get about 13 bits of effective dynamic range, with an acceptable level of distortion. The traditional codecs need very little processing to convert to linear analogue, but codecs like MP3, require a lot of processing, and also introduce extra delays.
In the early days of VoIP, especially with low wage country call centres, there was a demand for very low bitrate codecs. but now, the main demand is for higher audio quaility, although there is still a preference to keep the rate down and avoid too much CPU usage.