I need to create a small custom live system (for teaching a programming class). What would be the best way to do it?
If you want to build your own distribution, Try Linux From Scratch (LFS). It is a project that provides you with step-by-step instructions for building your own custom Linux system, entirely from source code. http://www.linuxfromscratch.org/
There are a lot of lightweight linux distributions available. Most of these can boot from LiveCD. http://lightlinux.blogspot.com/2008/06/top-10-of-lightweight-linux_24.html
This website is a list of all the Live CD distros with a ranking given by the users
I suggest you go with XUbuntu for programming purposes
If you are looking to use it for server tests try open SUSE
How about Morphix? http://www.morphix.org/ - includes a page on "Building a new LiveCD in two commands"!