The problem is that we're baking shadows dynamically (for reasons of performance, so shadow casting does not need to be performed every frame). Unfortunately the current implementation still has some limitations... the shadow maps are only updated if you modify the surrounding world (e.g. remove or place a block), but it doesn't react to dynamic elements like animated objects (e.g. doors), players, animals etc.
You can "fix" that by turning the lamp off and on again (this forces the game to recalculate the shadows), so it will recognize the closed door.
There is a hidden setting to force dynamic shadows, but that has a big impact on performance (and it gets worse the more lights you're using), so it's not recommendable to use that