That's usually the case for most Humanities disciplines (history, languages, literature etc), because their overheads are really low and there is an abundance of teaching professionals compared to actual audiences.
The opposite is true for "hard" sciences like chemistry, engineering or CS, where expensive laboratory equipment is necessary and where teaching resources are scarce (due to higher private-sector demand). There, courses are expensive, demanding and small in number, so they are usually inaccessible to the layman.
That's not really true. It's not challenging to find CS courses online, and the year I spent in a CS graduate program (through Colorado State), the cost per course unit for CS was the same as any humanities course.