I coded a program to parse a text file into a OpenCalc Spreadsheet just because someone asked me if it could be done.
I coded a program to solve Sudoku because a friend made one and challenged me to make one that was faster (his was).
I am still coding a whole MUD Engine in C# simply because I couldn't find a good one in this language and nor a friendly enough one in any other language I know. It is moving slowly since I want it to be generic enough so others can use it.
I still, every now and then, solve problems on Valladolid.
I can see your point that they could spend their time more wisely, but I beg to differ. A lot of people love to code and coding becomes the purpose on itself. The knowledge they are gaining WILL prove to be invaluable to them and to others and the fact that they are doing something because they want, not because they must will drive them much farther than if it was a commercial project. It will give them both the reasons and the will to hone it to perfection. I suggest you to read "Jonathan Livingston Seagull", if you haven't.