I had plenty of undergrad courses. But I started programming before all of that. Those courses can help make you a better programmer but they are by no means required for a programming course in middle or high school.
The great part about starting early is it opens a doorway. A student can start with basic knowledge of programming (e.g. flow charts, if-then statements, loops) and a personal goal (e.g. create a game) and be motivated enough to learn enough of the rest on their own (assuming they have a computer and either Internet access or relevant books). Self motivated learning is itself enough to warrant teaching programming at a young age.