Sounds like he has a healthy case of separation anxiety. You're going to have to help him understand that a closed door doesn't mean you're abandoning him and that you will be back. The way the Dog Whisperer contended with a case like yours was pretty simple. First, you put him in a room by himself for five minutes. Don't speak to him or acknowledge his presence in any way. When the five minutes are up, the door, let him out, praise him and give him a treat if you like. Do this each week (or at least every few days) gradually increasing the time he spends alone by five minutes in that room. This will help him associate his good behavior while in that room with a reward (like praise or a treat). As long as he knows he'll be getting something good out of the whole experience and that you are indeed coming back for him, he'll be good to go. Hope this helps.
P.S if he barks of misbehaves as he is now, let him out after his timeout's over anyway. Just don't give him any praise or treats and of course don't fuss at or punish him either. It will take time but he'll make the connection in due course. Remember praise good behavior and ignore the bad behavior.