RE: Can someone explain why he didnt just give the source over?
Because he wrote the software on his own time, and therefore it was his code. Handing it over means he gives up the potential of selling the software, or modifying it for other purposes and selling it in his future life outside of the military.
As for "owning his brain" and the like. It's true that most development companies do have these sorts of contracts, where anything you write, even on your own time and on your own equipment belongs to the company. You are made fully aware of this (or at least should be) usually on the day you start work and fill out all the other legal paperwork.
But this is actually pretty rare outside of the development community. Most employers just wouldn't consider that a future employee might create something worth stealing, and with government employees in the US enjoying almost UK levels of employee rights, it's unlikely they would think it legal to try to include this sort of ownership clause in employee contracts. Besides most contracts are the result of bargaining agreements with fairly powerful unions, which is why most government employees in the US still have decent workers rights.
I'm sure the military would think this is a great idea, and if it was common practice in private business, might try to do something similar if they were aware of the possibility. Fortunately they aren't, and because they have no proof he wrote the software on their time, or using their equipment, they can't force him to hand over the code.
This also means he's still free to adapt it and sell it to other businesses or better still, other branches of the US military. Which is of course one of the main reasons he'd refuse to give up his code in the first place.
What I would say is he missed the boat. Rather than going after the government for stealing his code, he should have gone after them for the demotion. It was his software, he had every right to refuse to hand over the code. It wasn't his fault they based his previous promotion on the value of the software, he wasn't stopping them from using it after all.
So if I was him, I'd start adapting and hawking my software to other branches of the US military, it's about the only safe avenue left for him to take. If they like it enough to steal it, chances are other branches of the US military will too.