The codes unlock the levels. It's useful for playing again so that you don't have to go through levels a second time or if you just want to go in real quick for the gaallery.