I am not sure about the part where leaving the office as soon as you are let go is expected.
I am not in the States, but when re-structurings were to happen at my previous employers, the employers has to specify if you are expected to leave immediately or if there is some work to be finished.
At an earlier point I was changing jobs. I had asked to work a few days longer to finish my task at hand, which was granted. It only seems reasonable thing to me.
To me, communication is a very large value. I would not require, or blame, the developer in this circumstance. If the employer did not specify or have processes when letting people go, it is an unprofessional attitude of the employer, not misunderstanding of the developer.