I would be interested in hearing the opinions of people who've been in this situation, too. Seems like it could be beneficial to the community.
Someone also owns the code, I guess, and they might want to use it for something else at some point.
Some products might have been hack-jobs form the beginning that ballooned, they might work but they could be total hack jobs that would either A) be worthless on their own or B) slightly embarrassing to show.
I've not been in the situation from a company perspective, but I have taken a product I've made off from the shelves and the factors above came into play. I am sure there are more as well.
That's a rather uncharitable interpretation.
I think it's more likely that they don't know if they're licensed to publish the code in question.
- Libraries licensed for usage but not for open sourcing unless X, Y and Z.
Etc.