Yeah, I am not sure what the real value in open-sourcing the code would be because you can imagine how hard it would be trying to dig through a project that isn't designed like a library for re-use.
As jahmed said, it could be used as a learning experience. In other cases, it was a valiant (or not so) attempt at making something great, that didn't work out for a variety of reasons. Depending on the scenario, it might be something that I'd like someone else to pick up from and continue, to fulfill the "I want to use this." itch, but I don't have the time/resources to execute properly.