The funny thing is most of those kids probably just want to learn how to make iphone apps and pretty websites but before they realize it they're stuck figuring out sorting algorithms and regex theory.
Actually using regexes seems a lot more common in the working world than in academia; as for the theory the basics of finite state machines are about as hard as sorting algorithms. (Or do most CS programs these days cover even more ways to implement a regex parser? http://news.ycombinator.com/item?id=4194707 I have no idea what most CS programs do other than produce BigCo BigLang employees, Stanford's sounds better than that from all I've read and heard.) So no, instead of sorting algorithms, maybe they'll give up at suffix tries or Haskell Monads or Lisp macros or relational databases or garbage collectors or JITs or Bayesian networks or operating systems or... And while I don't know much about iPhone apps, I think Android apps are at least as hard as InsertionSort() and probably more frustrating. You even have a consulting business around them--does anyone have a business around sorting algorithms?
Who knows what their motivations are? Someone at Stanford should do a poll. I'd bet the same amount on "want to make something easy-sounding and specific like phone apps", "want to make lots of money doing who knows what" (maybe even as concrete as working for BigCo or doing a startup), and "because it sounds interesting/friends are doing it/other social reasons". If we're going to imagine them as fairly dim, it's easier to imagine they have no concrete goal in mind. (Edit: and according to my sibling comment, since majors aren't declared until later we probably shouldn't be imagining these students as dim.)