I'm not even sure that would have been a useful distribution method for the first Ubuntu release, in 2004. Waiting to receive a posted CD would take longer than downloading even KDE or the kernel's source code.
A posted CD in Germany took a day to arrive (when sent from Germany, and there were people who'd send it locally), downloading the source code for a few large packages could easily take a week on dial-up.
In 1998 maybe, though 1 hour at even 48kbit/s is 20 megabytes, which is a decent-sized program's source. (The Linux kernel source in 2003 was about 25MB, compressed.)
What's so special about 2004? My parents finally got on DSL in 2008, but until then we — and many friends I knew — were still on dial-up. (Using the good old web.de smart surfer tool, if anyone still remembers that)
And remember, if you wanted to customize something you'd usually need not just one program's source, but also the libraries. Downloading all of Qt and most of KDE to customize something and build it from source took a loooong time.
I was using dial-up up to 2008, included. It could push 10 megabytes an hour at best, and even that only late at night. An hour of dial-up was on the order of 0.05-0.1% of a typical monthly salary back then.
So even if you were willing to spend 10% of your monthly income (which is impractical, but this is an extreme example), it could buy you maybe 1-2 gigabytes of data. Or you could just, you know, order a (source or binary) CD for free or almost free.
You could often get much cheaper connections, during odd hours in the middle of the night. But then you'd have to chunk the transfer over days or weeks.
I think more common case than postage was downloading ISO on fast office internet and then burning CD-R to carry home; this was era when CD-Rs were the widely available convenient large-capacity portable media. Although that began to be already waning, it was around that time that multi-gigabyte flash drives started appearing.
That is probably the best reason these CDs were made — legal requirement.
That requirement was removed in GPL version 3, where you could distribute binaries however you like and direct people to an HTTP/FTP site for the source. GPL 2 requires the same distribution method to be used.
Monthly computer magazines included CDs with all kinds of software (open source, shareware, freeware, older releases of paid software) and linux distributions. Different software each month, Ubuntu maybe in the issue after an Ubuntu release.
Been there, done that.