The password part is a bit silly. You don't even need to do that. Just leave it rough around the edges and give people a technical description of how to use the tool. I've done that accidentally a number of times. It's amazing how many times, people just give up without even trying.
He states thought that the boss who fired him called later to demand the password. A somewhat likely motive for this was so he could utilise the code for himself, fire a bunch of the workers and then claim the credit for the productivity bump and cost savings.
I'd rather not make life easier for such people. What this kid did turned out to be a win.
The only puzzling aspect of this story is why he took the same money back. He has demonstrated value far beyond his pay grade and was hired back at the same compensation as before. Why?
The same base plus the performance-linked bonus he was getting for doing most of the data entry with his program. It came to more than what his old boss was making, so it wasn't just data-entry wages.
This doesn't consider the value he's creating for the company. Apparently, the company was willing to part with that money already (before the improvement) - so clearly they should have offered him more for the automation.
The bonus pool he was drawing from was meant to go to an entire team of people, but 90% of it was going to him. His pay ended up being quite a bit higher than what it should have been.
I wonder if the story would have turned out the same without the password? It seems like the password may have created a mystery that prompted them to want to see what's inside. If it simply worked poorly/not at all without a trained operator, it likely would have been thrown away instead.